org.oddjob.values.properties
Class PropertiesBase

java.lang.Object
  extended by org.oddjob.values.properties.PropertiesBase
All Implemented Interfaces:
ArooaContextAware
Direct Known Subclasses:
PropertiesType

public class PropertiesBase
extends Object
implements ArooaContextAware

Base class for things that load Properties.


Constructor Summary
PropertiesBase()
           
 
Method Summary
 String getExtract()
          Getter for extract.
 String getPrefix()
          Getter for prefix.
 Properties getSets(int index)
          Indexed getter for sets.
 PropertySource getSource()
           
 boolean isFromXML()
          Getter for fromXML.
 boolean isSubstitute()
          Getter for substitute.
 void setArooaContext(ArooaContext context)
           
 void setExtract(String extract)
           
 void setFromXML(boolean fromXml)
           
 void setInput(InputStream input)
           
 void setPrefix(String prefix)
           
 void setSets(int index, Properties props)
           
 void setSource(PropertySource source)
           
 void setSubstitute(boolean substitute)
           
 void setValues(String key, String value)
           
protected  Properties toProperties()
          The main method that provides the properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesBase

public PropertiesBase()
Method Detail

setArooaContext

public void setArooaContext(ArooaContext context)
Specified by:
setArooaContext in interface ArooaContextAware

toProperties

protected Properties toProperties()
                           throws IOException,
                                  ArooaConversionException
The main method that provides the properties.

Returns:
Properties, might be empty but never null.
Throws:
IOException
ArooaConversionException

setInput

public void setInput(InputStream input)

Property: input

Description: An input source for Properties.

Required: No.


setFromXML

public void setFromXML(boolean fromXml)

Property: fromXML

Description: If the input for the properties is in XML format.

Required: No, defaults to false.


isFromXML

public boolean isFromXML()
Getter for fromXML.

Returns:
true/false.

setValues

public void setValues(String key,
                      String value)

Property: values

Description: Properties defined as key value pairs.

Required: No.


setSets

public void setSets(int index,
                    Properties props)

Property: sets

Description: Extra properties to be merged into the overall property set.

Required: No.


getSets

public Properties getSets(int index)
Indexed getter for sets.

Parameters:
index - The index.
Returns:
The properites.

setSubstitute

public void setSubstitute(boolean substitute)

Property: substitute

Description: Use substitution for the values of ${} type properties.

Required: No.


isSubstitute

public boolean isSubstitute()
Getter for substitute.

Returns:
true/false.

getExtract

public String getExtract()
Getter for extract.

Returns:
The extract prefix or null.

setExtract

public void setExtract(String extract)

Property: extract

Description: Extract this prefix form property names. Filters out properties that do not begin with this prefix.

Required: No.


getPrefix

public String getPrefix()
Getter for prefix.

Returns:
The appending prefix or null.

setPrefix

public void setPrefix(String prefix)

Property: prefix

Description: Append this prefix to property names.

Required: No.


getSource

public PropertySource getSource()

setSource

public void setSource(PropertySource source)