Class Expression
java.lang.Object
org.apache.sling.scripting.sightly.compiler.expression.Expression
This class represents a HTL Expression.
-
Constructor Summary
ConstructorDescriptionExpression
(ExpressionNode root) Create an expression with just a root node.Expression
(ExpressionNode root, Map<String, ExpressionNode> options) Create an expression with a root node and options.Expression
(ExpressionNode root, Map<String, ExpressionNode> options, String rawText) Create an expression with a root node and options. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsOption
(String name) Checks whether the expression has the specified option.Get the options for this expression.Returns the raw text representation of this expression.getRoot()
Get the root node of this expression.removeOption
(String option) Removes the given option from this expression.toString()
withNode
(ExpressionNode node) Return a copy, but with the specified node as root.withRawText
(String rawText) Return a copy that provides information about the expression's raw text.
-
Constructor Details
-
Expression
Create an expression with just a root node.- Parameters:
root
- the root node
-
Expression
Create an expression with a root node and options.- Parameters:
root
- the root nodeoptions
- the expression's options
-
Expression
Create an expression with a root node and options.- Parameters:
root
- the root nodeoptions
- the expression's optionsrawText
- the expression's raw text representation
-
-
Method Details
-
getOptions
Get the options for this expression.- Returns:
- the expression options
-
getRoot
Get the root node of this expression.- Returns:
- the root node of this expression
-
removeOption
Removes the given option from this expression.- Parameters:
option
- the option to be removed- Returns:
- the option, or
null
if the option doesn't exist
-
withNode
Return a copy, but with the specified node as root.- Parameters:
node
- the new root- Returns:
- a copy with a new root
-
withRawText
Return a copy that provides information about the expression's raw text.- Parameters:
rawText
- the raw text representing the expression- Returns:
- a copy with information about the expression's raw text
-
getRawText
Returns the raw text representation of this expression.- Returns:
- the raw text representation of this expression
-
containsOption
Checks whether the expression has the specified option.- Parameters:
name
- the name of the option- Returns:
true
if the option is present,false
otherwise
-
toString
-