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

Quick Search    Search Deep

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

java.lang.Object
  extended bycom.sun.xacml.cond.FunctionBase
      extended bycom.sun.xacml.cond.BagFunction
          extended bycom.sun.xacml.cond.GeneralBagFunction
All Implemented Interfaces:
Function

public class GeneralBagFunction
extends BagFunction

Specific BagFunction class that supports all of the general-purpose bag functions: type-one-and-only, type-bag-size, and type-bag.

Since:
1.2

Nested Class Summary
private static class GeneralBagFunction.BagParameters
          Private class that is used for mapping each function to it set of parameters.
 
Field Summary
private static int ID_BASE_BAG
           
private static int ID_BASE_BAG_SIZE
           
private static int ID_BASE_ONE_AND_ONLY
           
private static java.util.HashMap paramMap
           
private static java.util.Set supportedIds
           
 
Fields inherited from class com.sun.xacml.cond.BagFunction
baseTypes, NAME_BASE_BAG, NAME_BASE_BAG_SIZE, NAME_BASE_IS_IN, NAME_BASE_ONE_AND_ONLY, simpleTypes
 
Fields inherited from class com.sun.xacml.cond.FunctionBase
FUNCTION_NS
 
Constructor Summary
GeneralBagFunction(java.lang.String functionName)
          Constructor that is used to create one of the general-purpose standard bag functions.
GeneralBagFunction(java.lang.String functionName, java.lang.String datatype, java.lang.String functionType)
          Constructor that is used to create instances of general-purpose bag functions for new (non-standard) datatypes.
 
Method Summary
 EvaluationResult evaluate(java.util.List inputs, com.sun.xacml.EvaluationCtx context)
          Evaluate the function, using the specified parameters.
private static java.lang.String getArgumentType(java.lang.String functionName)
          Private helper that returns the argument type for the given standard function.
private static java.lang.String getCustomReturnType(java.lang.String functionType, java.lang.String datatype)
          Private helper used by the custom datatype constructor to figure out what the return type is.
private static int getId(java.lang.String functionName)
          Private helper that returns the internal identifier used for the given standard function.
private static boolean getIsBag(java.lang.String functionName)
          Private helper that returns if the given standard function takes a bag.
private static int getNumArgs(java.lang.String functionName)
          Private helper that returns the argument count for the given standard function.
private static boolean getReturnsBag(java.lang.String functionName)
          Private helper that returns if the return type is a bag for the given standard function.
private static java.lang.String getReturnType(java.lang.String functionName)
          Private helper that returns the return type for the given standard function.
static java.util.Set getSupportedIdentifiers()
          Returns a Set containing all the function identifiers supported by this class.
 
Methods inherited from class com.sun.xacml.cond.BagFunction
getBagInstance, getBagSizeInstance, getIsInInstance, getOneAndOnlyInstance
 
Methods inherited from class com.sun.xacml.cond.FunctionBase
checkInputs, checkInputsNoBag, evalArgs, getFunctionId, getFunctionName, getIdentifier, getReturnType, getReturnTypeAsString, makeProcessingError, returnsBag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_BASE_ONE_AND_ONLY

private static final int ID_BASE_ONE_AND_ONLY
See Also:
Constant Field Values

ID_BASE_BAG_SIZE

private static final int ID_BASE_BAG_SIZE
See Also:
Constant Field Values

ID_BASE_BAG

private static final int ID_BASE_BAG
See Also:
Constant Field Values

paramMap

private static java.util.HashMap paramMap

supportedIds

private static java.util.Set supportedIds
Constructor Detail

GeneralBagFunction

public GeneralBagFunction(java.lang.String functionName)
Constructor that is used to create one of the general-purpose standard bag functions. The name supplied must be one of the standard XACML functions supported by this class, including the full namespace, otherwise an exception is thrown. Look in BagFunction for details about the supported names.


GeneralBagFunction

public GeneralBagFunction(java.lang.String functionName,
                          java.lang.String datatype,
                          java.lang.String functionType)
Constructor that is used to create instances of general-purpose bag functions for new (non-standard) datatypes. This is equivalent to using the getInstance methods in BagFunction and is generally only used by the run-time configuration code.

Method Detail

getId

private static int getId(java.lang.String functionName)
Private helper that returns the internal identifier used for the given standard function.


getArgumentType

private static java.lang.String getArgumentType(java.lang.String functionName)
Private helper that returns the argument type for the given standard function. Note that this doesn't check on the return value since the method always is called after getId, so we assume that the function is present.


getIsBag

private static boolean getIsBag(java.lang.String functionName)
Private helper that returns if the given standard function takes a bag. Note that this doesn't check on the return value since the method always is called after getId, so we assume that the function is present.


getNumArgs

private static int getNumArgs(java.lang.String functionName)
Private helper that returns the argument count for the given standard function. Note that this doesn't check on the return value since the method always is called after getId, so we assume that the function is present.


getReturnType

private static java.lang.String getReturnType(java.lang.String functionName)
Private helper that returns the return type for the given standard function. Note that this doesn't check on the return value since the method always is called after getId, so we assume that the function is present.


getReturnsBag

private static boolean getReturnsBag(java.lang.String functionName)
Private helper that returns if the return type is a bag for the given standard function. Note that this doesn't check on the return value since the method always is called after getId, so we assume that the function is present.


getCustomReturnType

private static java.lang.String getCustomReturnType(java.lang.String functionType,
                                                    java.lang.String datatype)
Private helper used by the custom datatype constructor to figure out what the return type is. Note that this doesn't check on the return value since the method always is called after getId, so we assume that the function is present.


getSupportedIdentifiers

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


evaluate

public EvaluationResult evaluate(java.util.List inputs,
                                 com.sun.xacml.EvaluationCtx context)
Evaluate the function, using the specified parameters.