org.jboss.security.xacml.sunxacml.cond
Class EqualFunction

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.cond.FunctionBase
      extended by org.jboss.security.xacml.sunxacml.cond.EqualFunction
All Implemented Interfaces:
Expression, Function

public class EqualFunction
extends FunctionBase

A class that implements all the *-equal functions. It takes two operands of the appropriate type and returns a BooleanAttribute indicating whether both of the operands are equal. If either of the operands is indeterminate, an indeterminate result is returned.

Since:
1.0
Author:
Steve Hanna, Seth Proctor

Field Summary
static String NAME_ANYURI_EQUAL
          Standard identifier for the anyURI-equal function.
static String NAME_BASE64BINARY_EQUAL
          Standard identifier for the base64Binary-equal function.
static String NAME_BOOLEAN_EQUAL
          Standard identifier for the boolean-equal function.
static String NAME_DATE_EQUAL
          Standard identifier for the date-equal function.
static String NAME_DATETIME_EQUAL
          Standard identifier for the dateTime-equal function.
static String NAME_DAYTIME_DURATION_EQUAL
          Standard identifier for the dayTimeDuration-equal function.
static String NAME_DNSNAME_EQUAL
          Standard identifier for the dnsName-equal function.
static String NAME_DOUBLE_EQUAL
          Standard identifier for the double-equal function.
static String NAME_HEXBINARY_EQUAL
          Standard identifier for the hexBinary-equal function.
static String NAME_INTEGER_EQUAL
          Standard identifier for the integer-equal function.
static String NAME_IPADDRESS_EQUAL
          Standard identifier for the ipAddress-equal function.
static String NAME_RFC822NAME_EQUAL
          Standard identifier for the rfc822Name-equal function.
static String NAME_STRING_EQUAL
          Standard identifier for the string-equal function.
static String NAME_TIME_EQUAL
          Standard identifier for the time-equal function.
static String NAME_X500NAME_EQUAL
          Standard identifier for the x500Name-equal function.
static String NAME_YEARMONTH_DURATION_EQUAL
          Standard identifier for the yearMonthDuration-equal function.
 
Fields inherited from class org.jboss.security.xacml.sunxacml.cond.FunctionBase
FUNCTION_NS, FUNCTION_NS_2
 
Constructor Summary
EqualFunction(String functionName)
          Creates a new EqualFunction object that supports one of the standard type-equal functions.
EqualFunction(String functionName, String argumentType)
          Creates a new EqualFunction object.
 
Method Summary
 EvaluationResult evaluate(List inputs, EvaluationCtx context)
          Evaluate the function, using the specified parameters.
static EqualFunction getEqualInstance(String functionName, String argumentType)
          Returns an EqualFunction that provides the type-equal functionality over the given attribute type.
static Set getSupportedIdentifiers()
          Returns a Set containing all the function identifiers supported by this class.
 
Methods inherited from class org.jboss.security.xacml.sunxacml.cond.FunctionBase
checkInputs, checkInputsNoBag, encode, encode, evalArgs, getFunctionId, getFunctionName, getIdentifier, getReturnType, getReturnTypeAsString, getType, makeProcessingError, returnsBag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_STRING_EQUAL

public static final String NAME_STRING_EQUAL
Standard identifier for the string-equal function.

See Also:
Constant Field Values

NAME_BOOLEAN_EQUAL

public static final String NAME_BOOLEAN_EQUAL
Standard identifier for the boolean-equal function.

See Also:
Constant Field Values

NAME_INTEGER_EQUAL

public static final String NAME_INTEGER_EQUAL
Standard identifier for the integer-equal function.

See Also:
Constant Field Values

NAME_DOUBLE_EQUAL

public static final String NAME_DOUBLE_EQUAL
Standard identifier for the double-equal function.

See Also:
Constant Field Values

NAME_DATE_EQUAL

public static final String NAME_DATE_EQUAL
Standard identifier for the date-equal function.

See Also:
Constant Field Values

NAME_TIME_EQUAL

public static final String NAME_TIME_EQUAL
Standard identifier for the time-equal function.

See Also:
Constant Field Values

NAME_DATETIME_EQUAL

public static final String NAME_DATETIME_EQUAL
Standard identifier for the dateTime-equal function.

See Also:
Constant Field Values

NAME_DAYTIME_DURATION_EQUAL

public static final String NAME_DAYTIME_DURATION_EQUAL
Standard identifier for the dayTimeDuration-equal function.

See Also:
Constant Field Values

NAME_YEARMONTH_DURATION_EQUAL

public static final String NAME_YEARMONTH_DURATION_EQUAL
Standard identifier for the yearMonthDuration-equal function.

See Also:
Constant Field Values

NAME_ANYURI_EQUAL

public static final String NAME_ANYURI_EQUAL
Standard identifier for the anyURI-equal function.

See Also:
Constant Field Values

NAME_X500NAME_EQUAL

public static final String NAME_X500NAME_EQUAL
Standard identifier for the x500Name-equal function.

See Also:
Constant Field Values

NAME_RFC822NAME_EQUAL

public static final String NAME_RFC822NAME_EQUAL
Standard identifier for the rfc822Name-equal function.

See Also:
Constant Field Values

NAME_HEXBINARY_EQUAL

public static final String NAME_HEXBINARY_EQUAL
Standard identifier for the hexBinary-equal function.

See Also:
Constant Field Values

NAME_BASE64BINARY_EQUAL

public static final String NAME_BASE64BINARY_EQUAL
Standard identifier for the base64Binary-equal function.

See Also:
Constant Field Values

NAME_IPADDRESS_EQUAL

public static final String NAME_IPADDRESS_EQUAL
Standard identifier for the ipAddress-equal function.

See Also:
Constant Field Values

NAME_DNSNAME_EQUAL

public static final String NAME_DNSNAME_EQUAL
Standard identifier for the dnsName-equal function.

See Also:
Constant Field Values
Constructor Detail

EqualFunction

public EqualFunction(String functionName)
Creates a new EqualFunction object that supports one of the standard type-equal functions. If you need to create an instance for a custom type, use the getEqualInstance method or the alternate constructor.

Parameters:
functionName - the standard XACML name of the function to be handled by this object, including the full namespace
Throws:
IllegalArgumentException - if the function isn't standard

EqualFunction

public EqualFunction(String functionName,
                     String argumentType)
Creates a new EqualFunction object.

Parameters:
functionName - the standard XACML name of the function to be handled by this object, including the full namespace
argumentType - the standard XACML name for the type of the arguments, inlcuding the full namespace
Method Detail

getEqualInstance

public static EqualFunction getEqualInstance(String functionName,
                                             String argumentType)
Returns an EqualFunction that provides the type-equal functionality over the given attribute type. This should be used to create new function instances for any new attribute types, and the resulting object should be put into the FunctionFactory (instances for the standard types are pre-installed in the standard factory).

Note that this method has the same affect as invoking the constructor with the same parameters. This method is provided as a convenience, and for symmetry with the bag and set functions.

Parameters:
functionName - the name to use for the function
argumentType - the type to operate on
Returns:
a new EqualFunction

getSupportedIdentifiers

public static Set getSupportedIdentifiers()
Returns a Set containing all the function identifiers supported by this class.

Returns:
a Set of Strings

evaluate

public EvaluationResult evaluate(List inputs,
                                 EvaluationCtx context)
Evaluate the function, using the specified parameters.

Parameters:
inputs - a List of Evaluatable objects representing the arguments passed to the function
context - an EvaluationCtx so that the Evaluatable objects can be evaluated
Returns:
an EvaluationResult representing the function's result


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.