|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.cond.VariableReference
public class VariableReference
This class supports the VariableReferenceType type introuced in XACML 2.0. It allows an expression to reference a variable definition. If there is no such definition then the Policy is invalid. A reference can be included anywwhere in an expression where the referenced expression would be valid.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 parsingMethod Detail |
---|
public 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
definition
ParsingException
- 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)
context
- the representation of the request
public 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
.
ProcessingException
- if the return type couldn't be resolvedpublic List getChildren()
List
public String encode()
VariableReference
into its XML form
String
public void encode(StringBuilder builder)
VariableReference
into its XML form and writes this out to the provided
StringBuilder
- Specified by:
encode
in interface Expression
- Parameters:
builder
- string stream into which the XML-encoded data is written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |