net.sf.sasl.language.placeholder.syntax.types
Class TypeValueNode<T>

java.lang.Object
  extended by net.sf.sasl.language.placeholder.syntax.ASTNode
      extended by net.sf.sasl.language.placeholder.syntax.types.TypeValueNode<T>
Direct Known Subclasses:
BooleanNode, DecimalNode, IntegerNode, StringNode

public abstract class TypeValueNode<T>
extends ASTNode

Defines an abstract node that can store a static known type value object. As of this, the node is a leaf node.

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Field Summary
 
Fields inherited from class net.sf.sasl.language.placeholder.syntax.ASTNode
INDENT_PER_DEPTH, INDENT_STRING
 
Constructor Summary
TypeValueNode()
          Creates an empty root type value node.
TypeValueNode(ASTNode parentNode)
          Creates a type value node that has the given parent.
TypeValueNode(T typeValue, ASTNode parentNode)
          Create a type value node with the given parent and type value.
 
Method Summary
 T getTypeValue()
          Returns the type value stored by this type value node.
 String prettyPrint(int indent)
          Returns a human readable string representation of the tree spanned of by this node.
 void setTypeValue(T typeValue)
          Sets the type value of this type value node.
 
Methods inherited from class net.sf.sasl.language.placeholder.syntax.ASTNode
getChildNodes, getParentNode, isLeafNode, isRootNode, setParentNode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeValueNode

public TypeValueNode()
Creates an empty root type value node.

Since:
0.0.1 (sasl-common-aspect-library)

TypeValueNode

public TypeValueNode(ASTNode parentNode)
Creates a type value node that has the given parent.

Parameters:
parentNode - null or non null.
Since:
0.0.1 (sasl-common-aspect-library)

TypeValueNode

public TypeValueNode(T typeValue,
                     ASTNode parentNode)
Create a type value node with the given parent and type value.

Parameters:
typeValue - null or non null.
parentNode - null or non null.
Since:
0.0.1 (sasl-common-aspect-library)
Method Detail

setTypeValue

public void setTypeValue(T typeValue)
                  throws IllegalArgumentException
Sets the type value of this type value node.

Parameters:
typeValue - null or non null. throws IllegalArgumentException if typeValue is null.
Throws:
IllegalArgumentException
Since:
0.0.1 (sasl-common-aspect-library)

getTypeValue

public T getTypeValue()
Returns the type value stored by this type value node.

Returns:
null or non null
Since:
0.0.1 (sasl-common-aspect-library)

prettyPrint

public String prettyPrint(int indent)
Description copied from class: ASTNode
Returns a human readable string representation of the tree spanned of by this node.

Specified by:
prettyPrint in class ASTNode
Parameters:
indent - how often ASTNode.INDENT_STRING should be printed in front of each new line at this tree depth.
Returns:
non null string
Since:
0.0.1 (sasl-common-aspect-library)
See Also:
ASTNode.prettyPrint(int)


Copyright © 2010. All Rights Reserved.