net.dpml.lang
Class ValueDirective

java.lang.Object
  extended by net.dpml.lang.AbstractDirective
      extended by net.dpml.lang.ValueDirective
All Implemented Interfaces:
Serializable

public class ValueDirective
extends AbstractDirective

A object resolvable from primitive arguments.

Version:
1.1.0
Author:
Digital Product Meta Library
See Also:
Serialized Form

Constructor Summary
ValueDirective(String value)
          Create a new value descriptor using the default java.lang.String class as the base type.
ValueDirective(String target, String value)
          Create a new construct using a supplied target definition.
ValueDirective(String target, String method, String value)
          Create a new construct using a supplied target defintion.
ValueDirective(String target, String method, ValueDirective[] args)
          Create a new construct using a supplied target defintion.
ValueDirective(String target, ValueDirective[] args)
          Create a new construct using a supplied target defintion.
 
Method Summary
 boolean equals(Object other)
          Compare this instance with a supplied object for equality.
 String getBaseValue()
          Return the base value of the resolved value.
 String getMethodName()
          Return the method name to be applied to the target object.
 String getTargetExpression()
          Return the classname of the resolved value.
 ValueDirective[] getValueDirectives()
          Return the set of nested values within this value.
 int hashCode()
          Compute the instance hashcode value.
 boolean isCompound()
          Return TRUE if this construct is a compund construct else FALSE.
 String toString()
          Return a string representation of the construct.
 
Methods inherited from class net.dpml.lang.AbstractDirective
equals, hashArray, hashValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueDirective

public ValueDirective(String value)
Create a new value descriptor using the default java.lang.String class as the base type.

Parameters:
value - the construct value

ValueDirective

public ValueDirective(String target,
                      String value)
Create a new construct using a supplied target definition. The target argument may be either a classname or a symbolic object reference in the form ${[key]}.

Parameters:
target - a classname or symbolic object reference
value - the construct value

ValueDirective

public ValueDirective(String target,
                      String method,
                      String value)
Create a new construct using a supplied target defintion. The target argument may be either a classname or a symbolic reference in the form ${[key]}. If the argument is symbolic it is resolved relative to a context map supplied by the application resolving construct values. If the construct value is symbolic the implementation will attempt to expand the reference relative to a context map (if supplied) otherwise the implementation will attempt to expand the value using system properties.

Parameters:
target - a classname or symbolic reference
method - the method to invoke on the target
value - the construct value

ValueDirective

public ValueDirective(String target,
                      ValueDirective[] args)
Create a new construct using a supplied target defintion. The target argument may be either a classname or a symbolic reference in the form ${[key]}. If the argument is symbolic it is resolved relative to a context map supplied by the application resolving construct values. Instance values resolved from the supplied Value[] will be used as constructor arguments when resolving the target.

Parameters:
target - the construct classname
args - an array of unresolved parameter values

ValueDirective

public ValueDirective(String target,
                      String method,
                      ValueDirective[] args)
Create a new construct using a supplied target defintion. The target argument may be either a classname or a symbolic reference in the form ${[key]}. If the argument is symbolic it is resolved relative to a context map supplied by the application resolving construct values. Instance values resolved from the supplied Value[] will be used as method arguments when resolving the target.

Parameters:
target - the construct classname
method - the method to invoke on the target
args - an array of unresolved parameter values
Method Detail

isCompound

public boolean isCompound()
Return TRUE if this construct is a compund construct else FALSE.

Returns:
TRUE if this ia a compound construct

getMethodName

public String getMethodName()
Return the method name to be applied to the target object.

Returns:
the method name

getValueDirectives

public ValueDirective[] getValueDirectives()
Return the set of nested values within this value.

Returns:
the nested values array

getBaseValue

public String getBaseValue()
Return the base value of the resolved value.

Returns:
the base value

getTargetExpression

public String getTargetExpression()
Return the classname of the resolved value.

Returns:
the classname

toString

public String toString()
Return a string representation of the construct.

Overrides:
toString in class Object
Returns:
the string value

equals

public boolean equals(Object other)
Compare this instance with a supplied object for equality.

Overrides:
equals in class AbstractDirective
Parameters:
other - the other object
Returns:
true if the supplied instance is equal to this instance

hashCode

public int hashCode()
Compute the instance hashcode value.

Overrides:
hashCode in class AbstractDirective
Returns:
the hashcode