Class BooleanConstant
- java.lang.Object
-
- org.apache.sling.scripting.sightly.compiler.expression.nodes.BooleanConstant
-
- All Implemented Interfaces:
ExpressionNode,Atom
public final class BooleanConstant extends java.lang.Object implements Atom
Defines a Boolean constant (e.g. "true" or "false").
-
-
Field Summary
Fields Modifier and Type Field Description static BooleanConstantFALSEstatic BooleanConstantTRUE
-
Constructor Summary
Constructors Constructor Description BooleanConstant(boolean value)Creates a boolean constant from a boolean value.BooleanConstant(java.lang.String text)Creates a boolean constant from a raw string.
-
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.java.lang.StringgetText()Get the text content for this nodesbooleangetValue()Returns the boolean value of the constant.java.lang.StringtoString()
-
-
-
Field Detail
-
FALSE
public static final BooleanConstant FALSE
-
TRUE
public static final BooleanConstant TRUE
-
-
Constructor Detail
-
BooleanConstant
public BooleanConstant(java.lang.String text)
Creates a boolean constant from a raw string.- Parameters:
text- the raw string
-
BooleanConstant
public BooleanConstant(boolean value)
Creates a boolean constant from a boolean value.- Parameters:
value- the value from which this constant is created
-
-
Method Detail
-
getValue
public boolean getValue()
Returns the boolean value of the constant.- Returns:
- the boolean value of the constant
-
getText
public java.lang.String getText()
Description copied from interface:AtomGet the text content for this nodes
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-