Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.xacml.cond
Class Apply  view Apply download Apply.java

java.lang.Object
  extended bycom.sun.xacml.cond.Apply
All Implemented Interfaces:
Evaluatable

public class Apply
extends java.lang.Object
implements Evaluatable

Represents the XACML ApplyType and ConditionType XML types.

Since:
1.0

Field Summary
private  Function bagFunction
           
private  java.util.List evals
           
private  Function function
           
private  boolean isCondition
           
 
Constructor Summary
Apply(Function function, java.util.List evals, boolean isCondition)
          Constructs an Apply object.
Apply(Function function, java.util.List evals, Function bagFunction, boolean isCondition)
          Constructs an Apply object that contains a higher-order bag function.
 
Method Summary
 void encode(java.io.OutputStream output)
          Encodes this Apply into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(java.io.OutputStream output, com.sun.xacml.Indenter indenter)
          Encodes this Apply into its XML representation and writes this encoding to the given OutputStream with indentation.
 EvaluationResult evaluate(com.sun.xacml.EvaluationCtx context)
          Evaluates the apply object using the given function.
 boolean evaluatesToBag()
          Returns whether or not the Function will return a bag of values on evaluation.
 java.util.List getChildren()
          Returns the List of children for this Apply.
static Apply getConditionInstance(org.w3c.dom.Node root, java.lang.String xpathVersion)
          Returns an instance of an Apply based on the given DOM root node.
 Function getFunction()
          Returns the Function used by this Apply.
private static Function getFunction(org.w3c.dom.Node root, java.lang.String version, FunctionFactory factory)
          Helper method that tries to get a function instance
 Function getHigherOrderFunction()
          Returns the higher order bag function used by this Apply if it exists, or null if no higher order function is used.
private static Apply getInstance(org.w3c.dom.Node root, FunctionFactory factory, boolean isCondition, java.lang.String xpathVersion)
          This is a helper method that is called by the two getInstance methods.
static Apply getInstance(org.w3c.dom.Node root, java.lang.String xpathVersion)
          Returns an instance of Apply based on the given DOM root.
 java.net.URI getType()
          Returns the type of attribute that this object will return on a call to evaluate.
 boolean isCondition()
          Returns whether or not this ApplyType is actually a ConditionType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

function

private Function function

evals

private java.util.List evals

bagFunction

private Function bagFunction

isCondition

private boolean isCondition
Constructor Detail

Apply

public Apply(Function function,
             java.util.List evals,
             boolean isCondition)
      throws java.lang.IllegalArgumentException
Constructs an Apply object. Throws an IllegalArgumentException if the given parameter list isn't valid for the given function.


Apply

public Apply(Function function,
             java.util.List evals,
             Function bagFunction,
             boolean isCondition)
      throws java.lang.IllegalArgumentException
Constructs an Apply object that contains a higher-order bag function. Throws an IllegalArgumentException if the given parameter list isn't valid for the given function.

Method Detail

getConditionInstance

public static Apply getConditionInstance(org.w3c.dom.Node root,
                                         java.lang.String xpathVersion)
                                  throws com.sun.xacml.ParsingException
Returns an instance of an Apply based on the given DOM root node. This will actually return a special kind of Apply, namely an XML ConditionType, which is the root of the condition logic in a RuleType. A ConditionType is the same as an ApplyType except that it must use a FunctionId that returns a boolean value.


getInstance

public static Apply getInstance(org.w3c.dom.Node root,
                                java.lang.String xpathVersion)
                         throws com.sun.xacml.ParsingException
Returns an instance of Apply based on the given DOM root.


getInstance

private static Apply getInstance(org.w3c.dom.Node root,
                                 FunctionFactory factory,
                                 boolean isCondition,
                                 java.lang.String xpathVersion)
                          throws com.sun.xacml.ParsingException
This is a helper method that is called by the two getInstance methods. It takes a factory so we know that we're getting the right kind of function.


getFunction

private static Function getFunction(org.w3c.dom.Node root,
                                    java.lang.String version,
                                    FunctionFactory factory)
                             throws com.sun.xacml.ParsingException
Helper method that tries to get a function instance


getFunction

public Function getFunction()
Returns the Function used by this Apply.


getChildren

public java.util.List getChildren()
Returns the List of children for this Apply. The List contains Evaluatables. The list is unmodifiable, and may be empty.

Specified by:
getChildren in interface Evaluatable

getHigherOrderFunction

public Function getHigherOrderFunction()
Returns the higher order bag function used by this Apply if it exists, or null if no higher order function is used.


isCondition

public boolean isCondition()
Returns whether or not this ApplyType is actually a ConditionType.


evaluate

public EvaluationResult evaluate(com.sun.xacml.EvaluationCtx context)
Evaluates the apply object using the given function. This will in turn call evaluate on all the given parameters, some of which may be other Apply objects.

Specified by:
evaluate in interface Evaluatable

getType

public java.net.URI getType()
Returns the type of attribute that this object will return on a call to evaluate. In practice, this will always be the same as the result of calling getReturnType on the function used by this object.

Specified by:
getType in interface Evaluatable

evaluatesToBag

public boolean evaluatesToBag()
Returns whether or not the Function will return a bag of values on evaluation.

Specified by:
evaluatesToBag in interface Evaluatable

encode

public void encode(java.io.OutputStream output)
Encodes this Apply into its XML representation and writes this encoding to the given OutputStream with no indentation.

Specified by:
encode in interface Evaluatable

encode

public void encode(java.io.OutputStream output,
                   com.sun.xacml.Indenter indenter)
Encodes this Apply into its XML representation and writes this encoding to the given OutputStream with indentation.

Specified by:
encode in interface Evaluatable