Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/cond
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21866/com/sun/xacml/cond
Modified Files:
Apply.java Evaluatable.java Expression.java
ExpressionHandler.java Function.java FunctionBase.java
HigherOrderFunction.java MapFunction.java NOfFunction.java
VariableDefinition.java VariableManager.java
VariableReference.java
Added Files:
Condition.java
Log Message:
substantial update to align 2.0 features (Target and Condition) and code
re-factoring to better handle Expression/Evaluatable, versions, Target, etc.
Index: NOfFunction.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/cond/NOfFunction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** NOfFunction.java 18 Mar 2004 21:13:09 -0000 1.4
--- NOfFunction.java 5 Dec 2005 23:34:51 -0000 1.5
***************
*** 3,7 ****
* @(#)NOfFunction.java
*
! * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
--- 3,7 ----
* @(#)NOfFunction.java
*
! * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
***************
*** 177,181 ****
Object [] list = inputs.toArray();
for (int i = 0; i < list.length; i++)
! if (((Evaluatable)(list[i])).evaluatesToBag())
throw new IllegalArgumentException("n-of can't use bags");
--- 177,181 ----
Object [] list = inputs.toArray();
for (int i = 0; i < list.length; i++)
! if (((Evaluatable)(list[i])).returnsBag())
throw new IllegalArgumentException("n-of can't use bags");
Index: Evaluatable.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/cond/Evaluatable.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Evaluatable.java 7 Jan 2005 23:49:32 -0000 1.5
--- Evaluatable.java 5 Dec 2005 23:34:51 -0000 1.6
***************
*** 3,7 ****
* @(#)Evaluatable.java
*
! * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
--- 3,7 ----
* @(#)Evaluatable.java
*
! * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
***************
*** 50,57 ****
/**
! * Generic interface that is implemented by all objects that can appear in
! * an ApplyType. This lets the evaluation code of <code>Apply</code> and
! * functions iterate through their members and evaluate them, working only
! * on the returned values or errors.
*
* @since 1.0
--- 50,57 ----
/**
! * Generic interface that is implemented by all objects that can be evaluated
! * directly (<code>AttributeDesignator</code>, <code>Apply</code>,
! * <code>AttributeValue</code>, etc.). As of version 2.0 several methods
! * were extracted to the new <code>Expression</code> super-interface.
*
* @since 1.0
***************
*** 72,86 ****
/**
- * Get the type of this object. This may be the data type of an
- * <code>Attribute</code> or the return type of an
- * <code>AttributeDesignator</code>, etc.
- *
- * @return the type of data represented by this object
- */
- public URI getType();
-
- /**
* Tells whether evaluation will return a bag or a single value.
*
* @return true if evaluation will return a bag, false otherwise
*/
--- 72,80 ----
/**
* Tells whether evaluation will return a bag or a single value.
*
+ * @deprecated As of 2.0, you should use the <code>returnsBag</code>
+ * method from the super-interface <code>Expression</code>.
+ *
* @return true if evaluation will return a bag, false otherwise
*/
***************
*** 96,117 ****
public List getChildren();
- /**
- * Encodes this <code>Evaluatable</code> into its XML representation and
- * writes this encoding to the given <code>OutputStream</code> with no
- * indentation.
- *
- * @param output a stream into which the XML-encoded data is written
- */
- public void encode(OutputStream output);
-
- /**
- * Encodes this <code>Evaluatable</code> into its XML representation and
- * writes this encoding to the given <code>OutputStream</code> with
- * indentation.
- *
- * @param output a stream into which the XML-encoded data is written
- * @param indenter an object that creates indentation strings
- */
- public void encode(OutputStream output, Indenter indenter);
-
}
--- 90,92 ----
Index: HigherOrderFunction.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/cond/HigherOrderFunction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** HigherOrderFunction.java 7 Jan 2005 23:49:32 -0000 1.9
--- HigherOrderFunction.java 5 Dec 2005 23:34:51 -0000 1.10
***************
*** 3,7 ****
* @(#)HigherOrderFunction.java
*
! * Copyright 2003-20045Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
--- 3,7 ----
* @(#)HigherOrderFunction.java
*
! * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
***************
*** 38,41 ****
--- 38,42 ----
import com.sun.xacml.EvaluationCtx;
+ import com.sun.xacml.Indenter;
import com.sun.xacml.attr.AttributeValue;
***************
*** 43,46 ****
--- 44,50 ----
import com.sun.xacml.attr.BooleanAttribute;
+ import java.io.OutputStream;
+ import java.io.PrintStream;
+
import java.net.URI;
import java.net.URISyntaxException;
***************
*** 180,192 ****
/**
- * Returns false since functions aren't directly evaluatable.
- *
- * @return false
- */
- public boolean isEvaluatable() {
- return false;
- }
-
- /**
* Returns a <code>Set</code> containing all the function identifiers
* supported by this class.
--- 184,187 ----
***************
*** 265,278 ****
}
! // get the two inputs ... note that unlike other functions, we don't
! // have to evaluate here, since the Apply code did it for us already
! // to handle any Indeterminate cases
AttributeValue [] args = new AttributeValue[2];
- args[0] = (AttributeValue)(iterator.next());
- args[1] = (AttributeValue)(iterator.next());
! // now we're ready to do the evaluation
! EvaluationResult result = null;
switch(functionId) {
--- 260,281 ----
}
! // get the two inputs, and if anything is INDETERMINATE, then we
! // stop right away
AttributeValue [] args = new AttributeValue[2];
! Evaluatable eval = (Evaluatable)(iterator.next());
! EvaluationResult result = eval.evaluate(context);
! if (result.indeterminate())
! return result;
! args[0] = (AttributeValue)(result.getAttributeValue());
! eval = (Evaluatable)(iterator.next());
! result = eval.evaluate(context);
! if (result.indeterminate())
! return result;
! args[1] = (AttributeValue)(result.getAttributeValue());
!
! // now we're ready to do the evaluation
! result = null;
switch(functionId) {
***************
*** 433,441 ****
// the first arg might be a bag
! if (secondIsBag && (! eval1.evaluatesToBag()))
throw new IllegalArgumentException("first arg has to be a bag");
// the second arg must be a bag
! if (! eval2.evaluatesToBag())
throw new IllegalArgumentException("second arg has to be a bag");
--- 436,444 ----
// the first arg might be a bag
! if (secondIsBag && (! eval1.returnsBag()))
throw new IllegalArgumentException("first arg has to be a bag");
// the second arg must be a bag
! if (! eval2.returnsBag())
throw new IllegalArgumentException("second arg has to be a bag");
***************
*** 564,566 ****
--- 567,594 ----
}
+ /**
+ * Encodes this <code>HigherOrderFunction</code> into its XML
+ * representation and writes this encoding to the given
+ * <code>OutputStream</code> with no indentation.
+ *
+ * @param output a stream into which the XML-encoded data is written
+ */
+ public void encode(OutputStream output) {
+ encode(output, new Indenter(0));
+ }
+
+ /**
+ * Encodes this <code>HigherOrderFunction</code> into its XML
+ * representation and writes this encoding to the given
+ * <code>OutputStream</code> with indentation.
+ *
+ * @param output a stream into which the XML-encoded data is written
+ * @param indenter an object that creates indentation strings
+ */
+ public void encode(OutputStream output, Indenter indenter) {
+ PrintStream out = new PrintStream(output);
+ out.println(indenter.makeString() + "<Function FunctionId=\"" +
+ getIdentifier().toString() + "\"/>");
+ }
+
}
Index: FunctionBase.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/cond/FunctionBase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FunctionBase.java 7 Jan 2005 23:49:32 -0000 1.4
--- FunctionBase.java 5 Dec 2005 23:34:51 -0000 1.5
***************
*** 38,41 ****
--- 38,42 ----
import com.sun.xacml.EvaluationCtx;
+ import com.sun.xacml.Indenter;
import com.sun.xacml.attr.AttributeValue;
***************
*** 46,49 ****
--- 47,53 ----
import java.net.URISyntaxException;
+ import java.io.OutputStream;
+ import java.io.PrintStream;
+
import java.util.ArrayList;
import java.util.Arrays;
***************
*** 223,235 ****
/**
- * Returns false since functions aren't directly evaluatable.
- *
- * @return false
- */
- public boolean isEvaluatable() {
- return false;
- }
-
- /**
* Returns the full identifier of this function, as known by the factories.
*
--- 227,230 ----
***************
*** 401,405 ****
if ((! eval.getType().toString().equals(paramType)) ||
! (eval.evaluatesToBag() != paramIsBag))
throw new IllegalArgumentException("illegal parameter");
}
--- 396,400 ----
if ((! eval.getType().toString().equals(paramType)) ||
! (eval.returnsBag() != paramIsBag))
throw new IllegalArgumentException("illegal parameter");
}
***************
*** 417,421 ****
if ((! eval.getType().toString().equals(paramTypes[i])) ||
! (eval.evaluatesToBag() != paramsAreBags[i]))
throw new IllegalArgumentException("illegal parameter");
--- 412,416 ----
if ((! eval.getType().toString().equals(paramTypes[i])) ||
! (eval.returnsBag() != paramsAreBags[i]))
throw new IllegalArgumentException("illegal parameter");
***************
*** 483,485 ****
--- 478,505 ----
}
+ /**
+ * Encodes this <code>FunctionBase</code> into its XML representation and
+ * writes this encoding to the given <code>OutputStream</code> with no
+ * indentation.
+ *
+ * @param output a stream into which the XML-encoded data is written
+ */
+ public void encode(OutputStream output) {
+ encode(output, new Indenter(0));
+ }
+
+ /**
+ * Encodes this <code>FunctionBase</code> into its XML representation and
+ * writes this encoding to the given <code>OutputStream</code> with
+ * indentation.
+ *
+ * @param output a stream into which the XML-encoded data is written
+ * @param indenter an object that creates indentation strings
+ */
+ public void encode(OutputStream output, Indenter indenter) {
+ PrintStream out = new PrintStream(output);
+ out.println(indenter.makeString() + "<Function FunctionId=\"" +
+ getFunctionName() + "\"/>");
+ }
+
}
Index: Expression.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/cond/Expression.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Expression.java 7 Jan 2005 23:49:32 -0000 1.1
--- Expression.java 5 Dec 2005 23:34:51 -0000 1.2
***************
*** 37,42 ****
--- 37,46 ----
package com.sun.xacml.cond;
+ import com.sun.xacml.Indenter;
+
import java.net.URI;
+ import java.io.OutputStream;
+
/**
***************
*** 48,67 ****
public interface Expression
{
!
/**
! * Returns true if this expression is evaluatable. Typically, this
! * is any expression type except for functions, which can't be
! * evaluated directly.
*
! * @return true if this expression is evaluatable
*/
! public boolean isEvaluatable();
/**
! * Returns the type of the expression.
*
! * @return the attribute type of the referenced expression
*/
! public URI getType();
}
--- 52,92 ----
public interface Expression
{
!
/**
! * Returns the type of the expression. This may be the data type of
! * an <code>AttributeValue</code>, the return type of a
! * <code>Function</code>, etc.
*
! * @return the attribute type of the referenced expression
*/
! public URI getType();
/**
! * Returns whether or not this expression returns, or evaluates to a
! * Bag. Note that <code>Evaluatable</code>, which extends this interface,
! * defines <code>evaluatesToBag</code> which is essentially the same
! * function. This method has been deprecated, and <code>returnsBag</code>
! * is now the preferred way to query all <code>Expression</code>s.
! */
! public boolean returnsBag();
!
! /**
! * Encodes this <code>Expression</code> into its XML representation and
! * writes this encoding to the given <code>OutputStream</code> with no
! * indentation.
*
! * @param output a stream into which the XML-encoded data is written
*/
! public void encode(OutputStream output);
!
! /**
! * Encodes this <code>Expression</code> into its XML representation and
! * writes this encoding to the given <code>OutputStream</code> with
! * indentation.
! *
! * @param output a stream into which the XML-encoded data is written
! * @param indenter an object that creates indentation strings
! */
! public void encode(OutputStream output, Indenter indenter);
}
Index: VariableReference.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/cond/VariableReference.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** VariableReference.java 7 Jan 2005 23:49:33 -0000 1.1
--- VariableReference.java 5 Dec 2005 23:34:51 -0000 1.2
***************
*** 40,43 ****
--- 40,44 ----
import com.sun.xacml.Indenter;
import com.sun.xacml.ParsingException;
+ import com.sun.xacml.PolicyMetaData;
import com.sun.xacml.ProcessingException;
***************
*** 65,69 ****
* @author Seth Proctor
*/
! public class VariableReference implements Evaluatable
{
--- 66,70 ----
* @author Seth Proctor
*/
! public class VariableReference implements Expression
{
***************
*** 124,127 ****
--- 125,129 ----
*
* @param root the DOM root of a VariableReferenceType XML type
+ * @param metaData the meta-data associated with the containing policy
* @param manager the <code>VariableManager</code> used to connect this
* reference to its definition
***************
*** 130,133 ****
--- 132,136 ----
*/
public static VariableReference getInstance(Node root,
+ PolicyMetaData metaData,
VariableManager manager)
throws ParsingException
***************
*** 144,156 ****
/**
- * Returns true since this expression is evaluatable.
- *
- * @return true
- */
- public boolean isEvaluatable() {
- return true;
- }
-
- /**
* Returns the reference identifier.
*
--- 147,150 ----
***************
*** 189,203 ****
*
* @return the result of evaluation
- *
- * @throws ProcessingException if the expression isn't evaluatable
*/
public EvaluationResult evaluate(EvaluationCtx context) {
Expression xpr = getReferencedDefinition().getExpression();
! if (xpr.isEvaluatable())
! return ((Evaluatable)xpr).evaluate(context);
!
! throw new ProcessingException("tried to evaluate an expression " +
! "that isn't evaluatable");
}
--- 183,197 ----
*
* @return the result of evaluation
*/
public EvaluationResult evaluate(EvaluationCtx context) {
Expression xpr = getReferencedDefinition().getExpression();
! // Note that it's technically possible for this expression to
! // be something like a Function, which isn't Evaluatable. It
! // wouldn't make sense to have this, but it is possible. Because
! // it makes no sense, however, it's unlcear exactly what the
! // error should be, so raising the ClassCastException here seems
! // as good an approach as any for now...
! return ((Evaluatable)xpr).evaluate(context);
}
***************
*** 231,249 ****
* @throws ProcessingException if the return type couldn't be resolved
*/
! public boolean evaluatesToBag() {
// see comment in getType()
if (definition != null) {
! Expression xpr = getReferencedDefinition().getExpression();
!
! // FIXME: for now we need to do this casting, but this should
! // change soon when the Function interface comes in line with
! // the Evaluatable type methods through the Expression interface
! if (xpr.isEvaluatable())
! return ((Evaluatable)xpr).evaluatesToBag();
! else
! return ((Function)xpr).returnsBag();
} else {
if (manager != null)
! return manager.evaluatesToBag(variableId);
}
--- 225,235 ----
* @throws ProcessingException if the return type couldn't be resolved
*/
! public boolean returnsBag() {
// see comment in getType()
if (definition != null) {
! return getReferencedDefinition().getExpression().returnsBag();
} else {
if (manager != null)
! return manager.returnsBag(variableId);
}
***************
*** 252,255 ****
--- 238,255 ----
/**
+ * Tells whether evaluation will return a bag or a single value.
+ *
+ * @return true if evaluation will return a bag, false otherwise
+ *
+ * @deprecated As of 2.0, you should use the <code>returnsBag</code>
+ * method from the super-interface <code>Expression</code>.
+ *
+ * @throws ProcessingException if the return type couldn't be resolved
+ */
+ public boolean evaluatesToBag() {
+ return returnsBag();
+ }
+
+ /**
* Always returns an empty list since references never have children in
* the policy tree. Note that the referenced definition may still have
--- NEW FILE: Condition.java ---
/*
* @(#)Condition.java
*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
* AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
* AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use in
* the design, construction, operation or maintenance of any nuclear facility.
*/
package com.sun.xacml.cond;
import com.sun.xacml.EvaluationCtx;
import com.sun.xacml.Indenter;
import com.sun.xacml.ParsingException;
import com.sun.xacml.PolicyMetaData;
import com.sun.xacml.attr.BooleanAttribute;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* 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
*
* @since 2.0
* @author Seth Proctor
*/
public class Condition implements Evaluatable
{
// a local Boolean URI that is used as the return type
private static URI booleanIdentifier;
// regardless of version, this contains the Condition's children
private List children;
// regardless of version, this is an expression that can be evaluated
// directly
private Expression expression;
// the condition function, which is only used if this is a 1.x condition
private Function function;
// flags whether this is XACML 1.x or 2.0
private boolean isVersionOne;
// initialize the boolean identifier
static {
try {
booleanIdentifier = new URI(BooleanAttribute.identifier);
} catch (Exception e) {
// we ignore this, since it cannot happen, but it should be
// flagged in case something changes to trip this case
booleanIdentifier = null;
}
}
/**
* Constructs a <code>Condition</code> as used in XACML 1.x.
*
* @param function the <code>Function</code> to use in evaluating the
* elements in the Condition
* @param xprs the contents of the Condition which will be the parameters
* to the function, each of which is an
* <code>Expression</code>
*
* @throws IllegalArgumentException if the input expressions don't
* match the signature of the function or
* if the function is invalid for use
* in a Condition
*/
public Condition(Function function, List expressions)
throws IllegalArgumentException
{
isVersionOne = true;
// check that the function is valid for a Condition
checkExpression(function);
// turn the parameters into an Apply for simplicity
expression = new Apply(function, expressions);
// keep track of the function and the children
this.function = function;
children = ((Apply)expression).getChildren();
}
/**
* Constructs a <code>Condition</code> as used in XACML 2.0.
*
* @param expression the child <code>Expression</code>
*
* @throws IllegalArgumentException if the expression is not boolean or
* returns a bag
*/
public Condition(Expression expression)
throws IllegalArgumentException
{
isVersionOne = false;
// check that the function is valid for a Condition
checkExpression(expression);
// store the expression
this.expression = expression;
// there is no function in a 2.0 Condition
function = null;
// store the expression as the child
List list = new ArrayList();
list.add(this.expression);
children = Collections.unmodifiableList(list);
}
/**
* Private helper for the constructors that checks if a given expression
* is valid for the root of a Condition
*/
private void checkExpression(Expression xpr) {
// make sure it's a boolean expression...
if (! xpr.getType().equals(booleanIdentifier))
throw new IllegalArgumentException("A Condition must return a " +
"boolean...cannot create " +
"with " + xpr.getType());
// ...and that it never returns a bag
if (xpr.returnsBag())
throw new IllegalArgumentException("A Condition must not return " +
"a Bag");
}
/**
* Returns an instance of <code>Condition</code> based on the given
* DOM root.
*
* @param root the DOM root of a ConditionType XML type
* @param metaData the meta-data associated with the containing policy
* @param manager <code>VariableManager</code> used to connect references
* and definitions while parsing
*
* @throws ParsingException if this is not a valid ConditionType
*/
public static Condition getInstance(Node root, PolicyMetaData metaData,
VariableManager manager)
throws ParsingException
{
if (metaData.getXACMLVersion() < PolicyMetaData.XACML_VERSION_2_0) {
Apply cond =
Apply.getConditionInstance(root, metaData.getXPathIdentifier(),
manager);
return new Condition(cond.getFunction(), cond.getChildren());
} else {
Expression xpr = null;
NodeList nodes = root.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
if (nodes.item(i).getNodeType() == Node.ELEMENT_NODE) {
xpr = ExpressionHandler.
parseExpression(nodes.item(i), metaData, manager);
break;
}
}
return new Condition(xpr);
}
}
/**
* Returns the <code>Function</code> used by this <code>Condition</code>
* if this is a 1.x condition, or null if this is a 2.0 condition.
*
* @return a <code>Function</code> or null
*/
public Function getFunction() {
return function;
}
/**
* Returns the <code>List</code> of children for this
* <code>Condition</code>. The <code>List</code> contains
* <code>Expression</code>s. The list is unmodifiable.
*
* @return a <code>List</code> of <code>Expression</code>s
*/
public List getChildren() {
return children;
}
/**
* Returns the type of attribute that this object will return on a call
* to <code>evaluate</code>. This is always a boolean, since that's
* all that a Condition is allowed to return.
*
* @return the boolean type
*/
public URI getType() {
return booleanIdentifier;
}
/**
* Returns whether or not this <code>Condition</code> will return a bag
* of values on evaluation. This always returns false, since a Condition
* isn't allowed to return a bag.
*
* @return false
*/
public boolean returnsBag() {
return false;
}
/**
* Returns whether or not this <code>Condition</code> will return a bag
* of values on evaluation. This always returns false, since a Condition
* isn't allowed to return a bag.
*
* @deprecated As of 2.0, you should use the <code>returnsBag</code>
* method from the super-interface <code>Expression</code>.
*
* @return false
*/
public boolean evaluatesToBag() {
return false;
}
/**
* Evaluates the <code>Condition</code> by evaluating its child
* <code>Expression</code>.
*
* @param context the representation of the request
*
* @return the result of trying to evaluate this condition object
*/
public EvaluationResult evaluate(EvaluationCtx context) {
// Note that it's technically possible for this expression to
// be something like a Function, which isn't Evaluatable. It
// wouldn't make sense to have this, but it is possible. Because
// it makes no sense, however, it's unlcear exactly what the
// error should be, so raising the ClassCastExceptio...
[truncated message content] |