public class VariableReference extends Object implements Expression, Evaluatable
| Constructor and Description |
|---|
VariableReference(String variableId)
Simple constructor that takes only the identifier.
|
VariableReference(String variableId,
VariableManager manager)
Constructor that takes the reference identifier and a manager.
|
VariableReference(VariableDefinition definition)
Constructor that takes the definition referenced by this class.
|
| Modifier and Type | Method and Description |
|---|---|
String |
encode()
Encodes this
VariableReference into its XML form |
void |
encode(StringBuilder builder)
Encodes this
VariableReference into its XML form and writes this out to the provided
StringBuilder |
EvaluationResult |
evaluate(EvaluationCtx context)
Evaluates the referenced expression using the given context, and either returns an error or a
resulting value.
|
boolean |
evaluatesToBag()
Deprecated.
As of 2.0, you should use the
returnsBag method from the
super-interface Expression. |
List |
getChildren()
Always returns an empty list since references never have children in the policy tree.
|
static VariableReference |
getInstance(Node root,
PolicyMetaData metaData,
VariableManager manager)
Returns a new instance of the
VariableReference class based on a DOM node. |
VariableDefinition |
getReferencedDefinition()
Returns the
VariableDefinition referenced by this class, or null if the
definition cannot be resolved. |
URI |
getType()
Returns the type of the referenced expression.
|
String |
getVariableId()
Returns the reference identifier.
|
boolean |
returnsBag()
Tells whether evaluation will return a bag or a single value.
|
public VariableReference(String variableId)
variableId - the reference identifierpublic VariableReference(VariableDefinition definition)
definition - the definition this class referencespublic VariableReference(String variableId, VariableManager manager)
variableId - the reference identifiermanager - a VariableManager used to handle the dependencies between
references and definitions during parsingpublic static VariableReference getInstance(Node root, PolicyMetaData metaData, VariableManager manager) throws ParsingException
VariableReference class based on a DOM node. The
node must be the root of an XML VariableReferenceType.root - the DOM root of a VariableReferenceType XML typemetaData - the meta-data associated with the containing policymanager - the VariableManager used to connect this reference to its
definitionParsingException - if the VariableReferenceType is invalidpublic String getVariableId()
public VariableDefinition getReferencedDefinition()
VariableDefinition referenced by this class, or null if the
definition cannot be resolved.public EvaluationResult evaluate(EvaluationCtx context)
evaluate in interface Evaluatablecontext - the representation of the requestpublic URI getType()
getType in interface ExpressionProcessingException - if the type couldn't be resolvedpublic boolean returnsBag()
returnsBag in interface ExpressionProcessingException - if the return type couldn't be resolvedpublic boolean evaluatesToBag()
returnsBag method from the
super-interface Expression.evaluatesToBag in interface EvaluatableProcessingException - if the return type couldn't be resolvedpublic List getChildren()
getChildren in interface EvaluatableListpublic String encode()
VariableReference into its XML formStringpublic void encode(StringBuilder builder)
VariableReference into its XML form and writes this out to the provided
StringBuilderencode in interface Expressionbuilder - string stream into which the XML-encoded data is writtenCopyright © 2019 WSO2. All rights reserved.