public final class Expression extends Object
Constructor and Description |
---|
Expression(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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsOption(String name)
Checks whether the expression has the specified option.
|
Map<String,ExpressionNode> |
getOptions()
Get the options for this expression.
|
String |
getRawText()
Returns the raw text representation of this expression.
|
ExpressionNode |
getRoot()
Get the root node of this expression.
|
ExpressionNode |
removeOption(String option)
Removes the given option from this expression.
|
String |
toString() |
Expression |
withNode(ExpressionNode node)
Return a copy, but with the specified node as root.
|
Expression |
withRawText(String rawText)
Return a copy that provides information about the expression's raw text.
|
public Expression(ExpressionNode root)
root
- the root nodepublic Expression(ExpressionNode root, Map<String,ExpressionNode> options)
root
- the root nodeoptions
- the expression's optionspublic Expression(ExpressionNode root, Map<String,ExpressionNode> options, String rawText)
root
- the root nodeoptions
- the expression's optionsrawText
- the expression's raw text representationpublic Map<String,ExpressionNode> getOptions()
public ExpressionNode getRoot()
public ExpressionNode removeOption(String option)
option
- the option to be removednull
if the option doesn't existpublic Expression withNode(ExpressionNode node)
node
- the new rootpublic Expression withRawText(String rawText)
rawText
- the raw text representing the expressionpublic String getRawText()
public boolean containsOption(String name)
name
- the name of the optiontrue
if the option is present, false
otherwiseCopyright © 2017 The Apache Software Foundation. All rights reserved.