net.sf.snver.pileup.config
Class AbstractConfigurationFactory

java.lang.Object
  extended by net.sf.snver.pileup.config.AbstractConfigurationFactory
Direct Known Subclasses:
IndividualConfigurationFactory, PoolConfigurationFactory

public abstract class AbstractConfigurationFactory
extends java.lang.Object

Abstract class for configuration object creation

Created by IntelliJ IDEA. User: weicheng hu Date: 11/21/11 Time: 10:41 AM


Field Summary
protected static java.lang.String NULL
           
 
Constructor Summary
AbstractConfigurationFactory()
           
 
Method Summary
protected  void afterParsing(java.util.Properties prop)
          Do special logic after the normal parsing routine
protected abstract  void beforeParsing(java.util.Properties prop)
           
protected  java.lang.String buildFileName(java.lang.String name)
          Remove the last file separator if necessary
 java.util.Properties createProperties(java.lang.String[] args)
          Update the user input properties onto the default properties object
 java.util.Properties getDefaultProperties()
          Build default properties object from a template
protected  void isComplete(java.util.Properties prop)
          Check completion for the properties object parsing routine
protected  boolean isValueValid(java.lang.String value, int type)
          Check for properties validation
protected  boolean onParsing(java.lang.String key, java.lang.String value, java.util.Properties prop)
          Do special logic before the normal parsing routine
protected abstract  void setMore(java.util.Properties prop)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

protected static final java.lang.String NULL
See Also:
Constant Field Values
Constructor Detail

AbstractConfigurationFactory

public AbstractConfigurationFactory()
Method Detail

getDefaultProperties

public java.util.Properties getDefaultProperties()
Build default properties object from a template

Returns:
Properties

setMore

protected abstract void setMore(java.util.Properties prop)

createProperties

public java.util.Properties createProperties(java.lang.String[] args)
                                      throws NoMatchOptionException,
                                             java.lang.NumberFormatException
Update the user input properties onto the default properties object

Parameters:
args - String[]
Returns:
Properties
Throws:
NoMatchOptionException - Error in parsing routine
java.lang.NumberFormatException - Error in parsing routine

beforeParsing

protected abstract void beforeParsing(java.util.Properties prop)

onParsing

protected boolean onParsing(java.lang.String key,
                            java.lang.String value,
                            java.util.Properties prop)
                     throws NoMatchOptionException,
                            java.lang.NumberFormatException
Do special logic before the normal parsing routine

Parameters:
key - String
value - String
prop - Properties
Returns:
boolean
Throws:
NoMatchOptionException - Error in parsing routine
java.lang.NumberFormatException - Error in parsing routine

afterParsing

protected void afterParsing(java.util.Properties prop)
Do special logic after the normal parsing routine

Parameters:
prop - Properties

isComplete

protected void isComplete(java.util.Properties prop)
                   throws NoMatchOptionException
Check completion for the properties object parsing routine

Parameters:
prop - Properties
Throws:
NoMatchOptionException - Error in parsing routine

isValueValid

protected boolean isValueValid(java.lang.String value,
                               int type)
                        throws NoMatchOptionException,
                               java.lang.NumberFormatException
Check for properties validation

Parameters:
value - String
type - Integer
Returns:
boolean
Throws:
NoMatchOptionException - Error in parsing routine
java.io.FileNotFoundException - Error in file operation
java.lang.NumberFormatException - Error in numeric conversion

buildFileName

protected java.lang.String buildFileName(java.lang.String name)
Remove the last file separator if necessary

Parameters:
name - String
Returns:
String