|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.security.xacml.sunxacml.cond.FunctionBase
public abstract class 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 XACML 1.0 spec-defined functions live |
static String |
FUNCTION_NS_2
The standard namespace where all XACML 2.0 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. |
void |
encode(OutputStream output)
Encodes this FunctionBase into its XML representation and
writes this encoding to the given OutputStream with no
indentation. |
void |
encode(OutputStream output,
Indenter indenter)
Encodes this FunctionBase into its XML representation and
writes this encoding to the given OutputStream with
indentation. |
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. |
URI |
getType()
Returns the same value as getReturnType. |
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 org.jboss.security.xacml.sunxacml.cond.Function |
|---|
evaluate |
| Field Detail |
|---|
public static final String FUNCTION_NS
public static final String FUNCTION_NS_2
| 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 values
public 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 values
public 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 values
public 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 values| Method Detail |
|---|
public URI getIdentifier()
getIdentifier in interface FunctionIllegalArgumentException - if the identifier isn't a valid URIpublic String getFunctionName()
public int getFunctionId()
public URI getType()
getReturnType. This is here
to support the Expression interface.
getType in interface Expressionpublic URI getReturnType()
getReturnType in interface FunctionURI indicating the attribute type
returned by this functionpublic boolean returnsBag()
returnsBag in interface ExpressionreturnsBag in interface Functionpublic 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 AttributeValues
generated from evaluating all parameters
null if no errors were encountered, otherwise
an EvaluationResult representing the error
public void checkInputs(List inputs)
throws IllegalArgumentException
checkInputs in interface Functioninputs - a List> of Evaluatables
IllegalArgumentException - if the inputs won't work
public void checkInputsNoBag(List inputs)
throws IllegalArgumentException
checkInputsNoBag in interface Functioninputs - a List> of Evaluatables
IllegalArgumentException - if the inputs won't workpublic void encode(OutputStream output)
FunctionBase into its XML representation and
writes this encoding to the given OutputStream with no
indentation.
encode in interface Expressionencode in interface Functionoutput - a stream into which the XML-encoded data is written
public void encode(OutputStream output,
Indenter indenter)
FunctionBase into its XML representation and
writes this encoding to the given OutputStream with
indentation.
encode in interface Expressionencode in interface Functionoutput - a stream into which the XML-encoded data is writtenindenter - an object that creates indentation strings
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||