org.progeeks.util.xml
Class SystemPropertyObjectHandler.SystemPropertyHolder

java.lang.Object
  extended by org.progeeks.util.xml.SystemPropertyObjectHandler.SystemPropertyHolder
Direct Known Subclasses:
SystemPropertyObjectHandler.ObjectPropertyHolder
Enclosing class:
SystemPropertyObjectHandler

public class SystemPropertyObjectHandler.SystemPropertyHolder
extends java.lang.Object

Class for storing the intermediate object containing the information for determining the system property value. Provides a way to resolve this information into the actual system property value.


Constructor Summary
protected SystemPropertyObjectHandler.SystemPropertyHolder()
          Protected constructor for subclasses that don't know their type yet.
  SystemPropertyObjectHandler.SystemPropertyHolder(java.lang.Class type)
          Constructor for the holder that sets what kind of property it will be resolving.
 
Method Summary
 java.lang.Object getDefaultValue()
          Returns the default value, already resolved into the proper object type (or null if no default is set).
 java.lang.String getKey()
          Returns the key (system property name) for the system property to use.
protected  java.lang.Class getType()
           
 java.lang.Object resolve()
          Resolves the property holder into the final value of the desired type.
 void setDefaultValue(java.lang.String value)
          Sets the default value of the property.
 void setKey(java.lang.String key)
          Sets the key (system property name) for the system property to use.
protected  void setType(java.lang.Class type)
          Sets the type that string properties will resolve to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemPropertyObjectHandler.SystemPropertyHolder

public SystemPropertyObjectHandler.SystemPropertyHolder(java.lang.Class type)
Constructor for the holder that sets what kind of property it will be resolving.


SystemPropertyObjectHandler.SystemPropertyHolder

protected SystemPropertyObjectHandler.SystemPropertyHolder()
Protected constructor for subclasses that don't know their type yet.

Method Detail

setType

protected void setType(java.lang.Class type)
Sets the type that string properties will resolve to. Protected to protect it but allow subclasses to expose if they want to.


getType

protected java.lang.Class getType()

setKey

public void setKey(java.lang.String key)
Sets the key (system property name) for the system property to use.


getKey

public java.lang.String getKey()
Returns the key (system property name) for the system property to use.


setDefaultValue

public void setDefaultValue(java.lang.String value)
Sets the default value of the property. The default value is parsed at this point to resolve it into the property type that we desire. This is done here so that any configuration errors for the default value are caught immediately and not only if the default value ends up being used.


getDefaultValue

public java.lang.Object getDefaultValue()
Returns the default value, already resolved into the proper object type (or null if no default is set).


resolve

public java.lang.Object resolve()
Resolves the property holder into the final value of the desired type.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.