net.sf.sasl.language.placeholder.syntax.types
Class StringNode

java.lang.Object
  extended by net.sf.sasl.language.placeholder.syntax.ASTNode
      extended by net.sf.sasl.language.placeholder.syntax.types.TypeValueNode<String>
          extended by net.sf.sasl.language.placeholder.syntax.types.StringNode
Direct Known Subclasses:
DoubleQuotedStringNode, SingleQuotedStringNode

public class StringNode
extends TypeValueNode<String>

Defines a string node that can store a string.

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
StringNode(String value)
          Creates a string node that has the given string value and no parent node.
StringNode(String value, ASTNode parentNode)
          Creates a string node that has the given string value and given parent node.
StringNode(String value, String ocString, ASTNode parentNode)
          Transforms the over given string value into a normalized string value where the open and close tag of the string is removed and all escapes of the open/close tag are replace with the open/close tag.
 
Method Summary
 String prettyPrint(int indent)
          Returns a human readable string representation of the tree spanned of by this node.
 
Methods inherited from class net.sf.sasl.language.placeholder.syntax.types.TypeValueNode
getTypeValue, setTypeValue
 
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

StringNode

public StringNode(String value,
                  String ocString,
                  ASTNode parentNode)
           throws IllegalArgumentException
Transforms the over given string value into a normalized string value where the open and close tag of the string is removed and all escapes of the open/close tag are replace with the open/close tag.

Parameters:
value - non null value.
ocString - non null open/close tag of the string.
parentNode - null or non null parent node
Throws:
IllegalArgumentException - if value is null or not a well quoted string via ocString.
Since:
0.0.1 (sasl-common-aspect-library)

StringNode

public StringNode(String value,
                  ASTNode parentNode)
           throws IllegalArgumentException
Creates a string node that has the given string value and given parent node.

Parameters:
value - non null value.
parentNode - null or non null parent node
Throws:
IllegalArgumentException - if value is null.
Since:
0.0.1 (sasl-common-aspect-library)

StringNode

public StringNode(String value)
           throws IllegalArgumentException
Creates a string node that has the given string value and no parent node.

Parameters:
value - non null value.
Throws:
IllegalArgumentException - if value is null.
Since:
0.0.1 (sasl-common-aspect-library)
Method Detail

prettyPrint

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

Overrides:
prettyPrint in class TypeValueNode<String>
Parameters:
indent - how often ASTNode.INDENT_STRING should be printed in front of each new line at this tree depth.
Returns:
non null string
Throws:
IllegalArgumentException - if parameter indent is lesser than 0.
See Also:
ASTNode.prettyPrint(int)


Copyright © 2010. All Rights Reserved.