org.apache.naming.config
Class Config.Environment

java.lang.Object
  extended by org.apache.naming.config.Config.Environment
Enclosing class:
Config

public static final class Config.Environment
extends java.lang.Object

Configuration for an Environment entry. Environment entries represent JNDI environment properties that take values that are primitive java types. The Environment configuration includes the type, the value and the JNDI name as a string, relative to the initial context.


Constructor Summary
Config.Environment()
           
 
Method Summary
 java.lang.Object createValue()
          Tries to create an instance of type this.type using this.value.
 java.lang.String getName()
          Gets the name of this environment.
 java.lang.String getType()
          Returns the class name of this environment entry.
 java.lang.String getValue()
          Returns the value of this environment entry as a String.
 void setName(java.lang.String name)
          Sets the name of this environment.
 void setType(java.lang.String type)
          Sets the class name of this environment entry.
 void setValue(java.lang.String value)
          Sets the (String) value of this environment entry.
 java.lang.String toString()
          Returns the JNDI name, type and value of this environment entry as as String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Config.Environment

public Config.Environment()
Method Detail

getName

public java.lang.String getName()
Gets the name of this environment.

Returns:
name the name

setName

public void setName(java.lang.String name)
Sets the name of this environment.

Parameters:
name - the name

getType

public java.lang.String getType()
Returns the class name of this environment entry.

Returns:
Environment entry class name

setType

public void setType(java.lang.String type)
Sets the class name of this environment entry.

Parameters:
type - class name

getValue

public java.lang.String getValue()
Returns the value of this environment entry as a String.

Returns:
String representation of the value

setValue

public void setValue(java.lang.String value)
Sets the (String) value of this environment entry.

Parameters:
value -

toString

public java.lang.String toString()
Returns the JNDI name, type and value of this environment entry as as String.

Overrides:
toString in class java.lang.Object
Returns:
String representation of this environment entry.

createValue

public java.lang.Object createValue()
Tries to create an instance of type this.type using this.value.

Only primitive types are currently supported. Wrapper object valueOf methods are used and runtime exceptions are not handled. If this.type is not a primitive type, null is returned.

Returns:
object instance