net.sourceforge.saxadapter.examples.env
Interface Environment

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
EnvironmentImpl

public interface Environment
extends java.io.Serializable

The Environment object returns read-only constant object properties registered in the system environment. Properties can be retrieved as generic Object values or by their specific type.

Author:
Mark Priest

Field Summary
static java.lang.String HOST_IP_PROP
          Stores the ip address of the local machine
static java.lang.String HOST_NAME_PROP
          Stores the hostname of the local machine
 
Method Summary
 java.lang.Boolean getBooleanProperty(java.lang.String argName)
          Returns the requested property as a Boolean.
 java.util.Date getDateProperty(java.lang.String argName)
          Returns the requested property as a Date.
 java.lang.Double getDoubleProperty(java.lang.String argName)
          Returns the requested property as a Double.
 java.lang.Float getFloatProperty(java.lang.String argName)
          Returns the requested property as a Float.
 java.lang.Integer getIntegerProperty(java.lang.String argName)
          Returns the requested property as an Integer.
 java.lang.Long getLongProperty(java.lang.String argName)
          Returns the requested property as a Long.
 java.lang.Object getObjectProperty(java.lang.String argName)
          Returns a named property as an java.lang.Object type regardless of the underlying type
 java.lang.String getStringProperty(java.lang.String argName)
          Returns a String property from the configuration file
 void printProperties(java.io.OutputStream argOut)
          Prints all of the properties to the output stream.
 

Field Detail

HOST_NAME_PROP

public static final java.lang.String HOST_NAME_PROP
Stores the hostname of the local machine

HOST_IP_PROP

public static final java.lang.String HOST_IP_PROP
Stores the ip address of the local machine
Method Detail

getStringProperty

public java.lang.String getStringProperty(java.lang.String argName)
Returns a String property from the configuration file
Parameters:
argName - name of the property
Returns:
java.lang.String

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String argName)
Returns a named property as an java.lang.Object type regardless of the underlying type
Parameters:
argName - name of the property
Returns:
the property as an object
Throws:
ClassCastException -  

getLongProperty

public java.lang.Long getLongProperty(java.lang.String argName)
Returns the requested property as a Long. Can throw ClassCastException if the data type is incorrect.
Parameters:
argName - name of the property
Returns:
the property as a Long
Throws:
ClassCastException -  

getIntegerProperty

public java.lang.Integer getIntegerProperty(java.lang.String argName)
Returns the requested property as an Integer. Can throw ClassCastException if the data type is incorrect.
Parameters:
argName - name of the property
Returns:
the property as an Integer
Throws:
ClassCastException -  

getFloatProperty

public java.lang.Float getFloatProperty(java.lang.String argName)
Returns the requested property as a Float. Can throw ClassCastException if the data type is incorrect.
Parameters:
argName - name of the property
Returns:
the property as a Float
Throws:
ClassCastException -  

getDoubleProperty

public java.lang.Double getDoubleProperty(java.lang.String argName)
Returns the requested property as a Double. Can throw ClassCastException if the data type is incorrect.
Parameters:
argName - name of the property
Returns:
the property as a Double
Throws:
ClassCastException -  

getBooleanProperty

public java.lang.Boolean getBooleanProperty(java.lang.String argName)
Returns the requested property as a Boolean. Can throw ClassCastException if the data type is incorrect.
Parameters:
argName - name of the property
Returns:
the property as a Boolean
Throws:
ClassCastException -  

getDateProperty

public java.util.Date getDateProperty(java.lang.String argName)
Returns the requested property as a Date. Can throw ClassCastException if the data type is incorrect.
Parameters:
argName - name of the property
Returns:
the property as a Date
Throws:
ClassCastException -  

printProperties

public void printProperties(java.io.OutputStream argOut)
Prints all of the properties to the output stream.
Parameters:
argOut - the output stream on which to print properties
Throws:
ClassCastException -