nl.chess.it.util.config.examples.newvalidation
Class CustomValidationConfig

java.lang.Object
  extended bynl.chess.it.util.config.Config
      extended bynl.chess.it.util.config.examples.newvalidation.CustomValidationConfig

public class CustomValidationConfig
extends Config

This class shows how to provide project-specific validation on properties. It has a single method, that returns an int that is always even. This means that the caller can always be sure that the int returned is an even number.

It is possible to extend this behavior, to return real project specific objects. This is a matter of personal taste. Next to that, if a real project object is returned, it often requires a database to exist and functioning. Obviously this doesn't work when the configuration details are not known yet.

Version:
$Revision: 1.1.1.1 $
Author:
Guus Bosman (Chess iT)

Field Summary
static java.lang.String RESOURCE_NAME
          Name of the file we are looking for to read the configuration.
 
Constructor Summary
CustomValidationConfig(java.lang.String resourceName)
           
 
Method Summary
 int getAmountOfLegs()
          Return the amount of legs that has been defined in the properties.
 
Methods inherited from class nl.chess.it.util.config.Config
getBoolean, getDate, getDurationInMs, getExistingReadableFile, getInt, getMessageFormatPattern, getSizeInBytes, getString, getString, getStringArrayFromCommaString, getStringArrayFromCommaString, getURL, getValue, getWritableFile, hasValue, testMessageFormat, validateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_NAME

public static final java.lang.String RESOURCE_NAME
Name of the file we are looking for to read the configuration.

See Also:
Constant Field Values
Constructor Detail

CustomValidationConfig

public CustomValidationConfig(java.lang.String resourceName)
Method Detail

getAmountOfLegs

public int getAmountOfLegs()
Return the amount of legs that has been defined in the properties.

Returns:
Even number of legs.


Copyright © 2003-2005 Chess-iT. All Rights Reserved.