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