|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.cond.Condition
public class Condition
Represents the XACML ConditionType type. It contains exactly one child expression that is boolean and returns a single value. This class was added in XACML 2.0
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
String |
encode()
Encodes this Condition into its XML form |
void |
encode(StringBuilder builder)
Encodes this Condition into its XML form and writes this out to the provided
StringBuilder |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 Conditionexpressions
- the contents of the Condition which will be the parameters to the function, each
of which is an Expression
IllegalArgumentException
- 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 Expression
IllegalArgumentException
- if the expression is not boolean or returns a bagMethod Detail |
---|
public 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
parsing
ParsingException
- 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 Expression
s. The list is unmodifiable.
getChildren
in interface Evaluatable
List
of Expression
spublic URI getType()
evaluate
. This is always a boolean, since that's all that a Condition is allowed to return.
getType
in interface Expression
public 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 Expression
public 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 Evaluatable
public EvaluationResult evaluate(EvaluationCtx context)
Condition
by evaluating its child Expression
.
evaluate
in interface Evaluatable
context
- the representation of the request
public String encode()
Condition
into its XML form
String
public void encode(StringBuilder builder)
Condition
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 |