public class Condition extends Object implements Evaluatable
| Constructor and Description |
|---|
Condition(Expression expression)
Constructs a
Condition as used in XACML 2.0. |
Condition(Function function,
List expressions)
Constructs a
Condition as used in XACML 1.x. |
| Modifier and Type | Method and Description |
|---|---|
void |
encode(OutputStream output)
Encodes this
Condition into its XML representation and
writes this encoding to the given OutputStream with no
indentation. |
void |
encode(OutputStream output,
Indenter indenter)
Encodes this
Condition into its XML representation and
writes this encoding to the given OutputStream with
indentation. |
EvaluationResult |
evaluate(EvaluationCtx context)
Evaluates the
Condition by evaluating its child
Expression. |
boolean |
evaluatesToBag()
Deprecated.
As of 2.0, you should use the
returnsBag
method from the super-interface Expression. |
List |
getChildren()
Returns the
List of children for this
Condition. |
Function |
getFunction()
Returns the
Function used by this Condition
if this is a 1.x condition, or null if this is a 2.0 condition. |
static Condition |
getInstance(Node root,
PolicyMetaData metaData,
VariableManager manager)
Returns an instance of
Condition based on the given
DOM root. |
URI |
getType()
Returns the type of attribute that this object will return on a call
to
evaluate. |
boolean |
returnsBag()
Returns whether or not this
Condition will return a bag
of values on evaluation. |
public Condition(Function function, List expressions) throws IllegalArgumentException
Condition as used in XACML 1.x.function - the Function to use in evaluating the
elements in the Conditionxprs - the contents of the Condition which will be the parameters
to the function, each of which is an
ExpressionIllegalArgumentException - if the input expressions don't
match the signature of the function or
if the function is invalid for use
in a Conditionpublic Condition(Expression expression) throws IllegalArgumentException
Condition as used in XACML 2.0.expression - the child ExpressionIllegalArgumentException - if the expression is not boolean or
returns a bagpublic static Condition getInstance(Node root, PolicyMetaData metaData, VariableManager manager) throws ParsingException
Condition based on the given
DOM root.root - the DOM root of a ConditionType XML typemetaData - the meta-data associated with the containing policymanager - VariableManager used to connect references
and definitions while parsingParsingException - if this is not a valid ConditionTypepublic Function getFunction()
Function used by this Condition
if this is a 1.x condition, or null if this is a 2.0 condition.Function or nullpublic List getChildren()
List of children for this
Condition. The List contains
Expressions. The list is unmodifiable.getChildren in interface EvaluatableList of Expressionspublic URI getType()
evaluate. This is always a boolean, since that's
all that a Condition is allowed to return.getType in interface Expressionpublic boolean returnsBag()
Condition will return a bag
of values on evaluation. This always returns false, since a Condition
isn't allowed to return a bag.returnsBag in interface Expressionpublic boolean evaluatesToBag()
returnsBag
method from the super-interface Expression.Condition will return a bag
of values on evaluation. This always returns false, since a Condition
isn't allowed to return a bag.evaluatesToBag in interface Evaluatablepublic EvaluationResult evaluate(EvaluationCtx context)
Condition by evaluating its child
Expression.evaluate in interface Evaluatablecontext - the representation of the requestpublic void encode(OutputStream output)
Condition into its XML representation and
writes this encoding to the given OutputStream with no
indentation.encode in interface Expressionoutput - a stream into which the XML-encoded data is writtenpublic void encode(OutputStream output, Indenter indenter)
Condition into its XML representation and
writes this encoding to the given OutputStream with
indentation.encode in interface Expressionoutput - a stream into which the XML-encoded data is writtenindenter - an object that creates indentation stringsCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.