public class VariableReference extends Object implements 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 |
---|---|
void |
encode(OutputStream output)
Encodes this class into its XML representation and writes this
encoding to the given
OutputStream with no indentation. |
void |
encode(OutputStream output,
Indenter indenter)
Encodes this class into its XML representation and writes this
encoding to the given
OutputStream with indentation. |
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 Evaluatable
context
- the representation of the requestpublic URI getType()
getType
in interface Expression
ProcessingException
- if the type couldn't be resolvedpublic boolean returnsBag()
returnsBag
in interface Expression
ProcessingException
- if the return type couldn't be resolvedpublic boolean evaluatesToBag()
returnsBag
method from the super-interface Expression
.evaluatesToBag
in interface Evaluatable
ProcessingException
- if the return type couldn't be resolvedpublic List getChildren()
getChildren
in interface Evaluatable
List
public void encode(OutputStream output)
OutputStream
with no indentation.encode
in interface Expression
output
- a stream into which the XML-encoded data is writtenpublic void encode(OutputStream output, Indenter indenter)
OutputStream
with indentation.encode
in interface Expression
output
- a stream into which the XML-encoded data is writtenindenter
- an object that creates indentation stringsCopyright © 2023 JBoss by Red Hat. All rights reserved.