Class StringConstant
- java.lang.Object
-
- org.apache.sling.scripting.sightly.compiler.expression.nodes.StringConstant
-
- All Implemented Interfaces:
ExpressionNode,Atom
public final class StringConstant extends java.lang.Object implements Atom
Defines a simple string constant (e.g.'hello world').
-
-
Field Summary
Fields Modifier and Type Field Description static StringConstantEMPTYThe empty string constant.
-
Constructor Summary
Constructors Constructor Description StringConstant(java.lang.String text)Create a string constant node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(NodeVisitor<T> visitor)Accept a visitor to process this node.booleanequals(java.lang.Object obj)java.lang.StringgetText()Gets the string contentinthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final StringConstant EMPTY
The empty string constant.
-
-
Method Detail
-
accept
public <T> T accept(NodeVisitor<T> visitor)
Description copied from interface:ExpressionNodeAccept a visitor to process this node.- Specified by:
acceptin interfaceExpressionNode- Type Parameters:
T- the type of the visitor- Parameters:
visitor- The visitor- Returns:
- the node after it has been evaluated by the visitor
-
getText
public java.lang.String getText()
Gets the string content
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-