|
SunTM's XACML Implementation for JavaTM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.xacml.cond.FunctionBase
An abstract utility superclass for functions. Supplies several useful
methods, making it easier to implement a Function
. You can
extend this class or implement Function
directly, depending
on your needs.
Field Summary | |
static String |
FUNCTION_NS
The standard namespace where all the spec-defined functions live |
Constructor Summary | |
FunctionBase(String functionName,
int functionId,
String[] paramTypes,
boolean[] paramIsBag,
String returnType,
boolean returnsBag)
Constructor that sets up the function as having different types for each given parameter. |
|
FunctionBase(String functionName,
int functionId,
String returnType,
boolean returnsBag)
Constructor that sets up some basic values for functions that will take care of parameter checking on their own. |
|
FunctionBase(String functionName,
int functionId,
String paramType,
boolean paramIsBag,
int numParams,
int minParams,
String returnType,
boolean returnsBag)
Constructor that sets up the function as having some number of parameters all of the same given type. |
|
FunctionBase(String functionName,
int functionId,
String paramType,
boolean paramIsBag,
int numParams,
String returnType,
boolean returnsBag)
Constructor that sets up the function as having some number of parameters all of the same given type. |
Method Summary | |
void |
checkInputs(List inputs)
Default handling of input checking. |
void |
checkInputsNoBag(List inputs)
Default handling of input checking. |
protected EvaluationResult |
evalArgs(List params,
EvaluationCtx context,
AttributeValue[] args)
Evaluates each of the parameters, in order, filling in the argument array with the resulting values. |
int |
getFunctionId()
Returns the Identifier of the function to be handled by this particular object. |
String |
getFunctionName()
Returns the name of the function to be handled by this particular object. |
URI |
getIdentifier()
Returns the full identifier of this function, as known by the factories. |
URI |
getReturnType()
Get the attribute type returned by this function. |
String |
getReturnTypeAsString()
Returns the return type for this particular object. |
protected static EvaluationResult |
makeProcessingError(String message)
Create an EvaluationResult that indicates a
processing error with the specified message. |
boolean |
returnsBag()
Returns true if this function returns a bag of values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.xacml.cond.Function |
evaluate |
Field Detail |
public static final String FUNCTION_NS
Constructor Detail |
public FunctionBase(String functionName, int functionId, String paramType, boolean paramIsBag, int numParams, String returnType, boolean returnsBag)
numParams
is
-1, then the length is variable
functionName
- the name of this function as used by the factory
and any XACML policiesfunctionId
- an optional identifier that can be used by your
code for convenienceparamType
- the type of all parameters to this function, as used
by the factory and any XACML documentsparamIsBag
- whether or not every parameter is actually a bag
of valuesnumParams
- the number of parameters required by this function,
or -1 if any number are allowedreturnType
- the type returned by this function, as used by
the factory and any XACML documentsreturnsBag
- whether or not this function returns a bag of valuespublic FunctionBase(String functionName, int functionId, String paramType, boolean paramIsBag, int numParams, int minParams, String returnType, boolean returnsBag)
numParams
is
-1, then the length is variable, and then minParams
may
be used to specify a minimum number of parameters. If
numParams
is not -1, then minParams
is
ignored.
functionName
- the name of this function as used by the factory
and any XACML policiesfunctionId
- an optional identifier that can be used by your
code for convenienceparamType
- the type of all parameters to this function, as used
by the factory and any XACML documentsparamIsBag
- whether or not every parameter is actually a bag
of valuesnumParams
- the number of parameters required by this function,
or -1 if any number are allowedminParams
- the minimum number of parameters required if
numParams
is -1returnType
- the type returned by this function, as used by
the factory and any XACML documentsreturnsBag
- whether or not this function returns a bag of valuespublic FunctionBase(String functionName, int functionId, String[] paramTypes, boolean[] paramIsBag, String returnType, boolean returnsBag)
functionName
- the name of this function as used by the factory
and any XACML policiesfunctionId
- an optional identifier that can be used by your
code for convenienceparamTypes
- the type of each parameter, in order, required by
this function, as used by the factory and any XACML
documentsparamIsBag
- whether or not each parameter is actually a bag
of valuesreturnType
- the type returned by this function, as used by
the factory and any XACML documentsreturnsBag
- whether or not this function returns a bag of valuespublic FunctionBase(String functionName, int functionId, String returnType, boolean returnsBag)
functionName
- the name of this function as used by the factory
and any XACML policiesfunctionId
- an optional identifier that can be used by your
code for conveniencereturnType
- the type returned by this function, as used by
the factory and any XACML documentsreturnsBag
- whether or not this function returns a bag of valuesMethod Detail |
public URI getIdentifier()
getIdentifier
in interface Function
IllegalArgumentException
- if the identifier isn't a valid URIpublic String getFunctionName()
public int getFunctionId()
public URI getReturnType()
getReturnType
in interface Function
URI
indicating the attribute type
returned by this functionpublic boolean returnsBag()
returnsBag
in interface Function
public String getReturnTypeAsString()
protected static EvaluationResult makeProcessingError(String message)
EvaluationResult
that indicates a
processing error with the specified message. This method
may be useful to subclasses.
message
- a description of the error
(null
if none)
EvaluationResult
protected EvaluationResult evalArgs(List params, EvaluationCtx context, AttributeValue[] args)
params
- a List
of Evaluatable
objects representing the parameters to evaluatecontext
- the representation of the requestargs
- an array as long as the params List
that
will, on return, contain the AttributeValue
s
generated from evaluating all parameters
null
if no errors were encountered, otherwise
an EvaluationResult
representing the errorpublic void checkInputs(List inputs) throws IllegalArgumentException
checkInputs
in interface Function
inputs
- a List>
of Evaluatable
s
IllegalArgumentException
- if the inputs won't workpublic void checkInputsNoBag(List inputs) throws IllegalArgumentException
checkInputsNoBag
in interface Function
inputs
- a List>
of Evaluatable
s
IllegalArgumentException
- if the inputs won't work
|
Sun's XACML Implementation Version 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.