Class FirstOrderFunctionSignature<RETURN_T extends Value>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.func.FirstOrderFunctionSignature<RETURN_T>
-
- Type Parameters:
RETURN_T
- function's return type
- Direct Known Subclasses:
MultiParameterTypedFirstOrderFunctionSignature
,SingleParameterTypedFirstOrderFunctionSignature
public abstract class FirstOrderFunctionSignature<RETURN_T extends Value> extends Object
First-order function signature (name, return type, arity, parameter types)
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isVarArgs
Is the last parameter specified inparamTypes
considered as variable-length (like JavaMethod.isVarArgs()
), i.e.protected String
name
protected Datatype<RETURN_T>
returnType
protected static IllegalArgumentException
UNDEF_PARAMETER_TYPES_EXCEPTION
-
Constructor Summary
Constructors Modifier Constructor Description protected
FirstOrderFunctionSignature(String name, Datatype<RETURN_T> returnType, boolean varArgs)
Creates function signature
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getName()
Get function nameabstract List<? extends Datatype<?>>
getParameterTypes()
Get function parameter typesDatatype<RETURN_T>
getReturnType()
Get function return typeboolean
isVarArgs()
Returnstrue
if this method was declared to take a variable number of arguments; returnsfalse
otherwise.String
toString()
-
-
-
Field Detail
-
UNDEF_PARAMETER_TYPES_EXCEPTION
protected static final IllegalArgumentException UNDEF_PARAMETER_TYPES_EXCEPTION
-
name
protected final String name
-
isVarArgs
protected final boolean isVarArgs
Is the last parameter specified inparamTypes
considered as variable-length (like JavaMethod.isVarArgs()
), i.e. taking a variable number of arguments (0 or more) of the specified paramTypes[n-1] with n the size of paramTypes. In the following examples, '...' means varargs like in Java:Example 1: string-concat(string, string, string...) -> paramTypes={string, string, string}, isVarargs=true
Example 2: or(boolean...) -> paramTypes={boolean}, isVarargs=true (As you can see, isVarargs=true really means 0 or more args; indeed, the or function can take 0 parameter according to spec)
Example 3: n-of(integer, boolean...) -> paramTypes={integer, boolean}, isVarargs=true
Example 4: abs(integer) -> paramTypes={integer}, isVarargs=false
Example 5: string-equal(string, string) -> paramTypes={string, string}, isVarargs=false
Example 6: date-add-yearMonthDuration(date, yearMonthDuration) -> paramTypes={date, yearMonthDuration}, isVarargs=false
-
-
Constructor Detail
-
FirstOrderFunctionSignature
protected FirstOrderFunctionSignature(String name, Datatype<RETURN_T> returnType, boolean varArgs) throws IllegalArgumentException
Creates function signature- Parameters:
name
- function name (e.g. XACML-defined URI)returnType
- function's return typevarArgs
- true iff the function takes a variable number of arguments (like JavaMethod.isVarArgs()
, i.e. the final type inparamTypes
can be repeated 0 or more times to match a variable-length argumentExamples with varargs=true ('...' means varargs like in Java):
Example 1: string-concat(string, string, string...) -> paramTypes={string, string, string}
Example 2: or(boolean...) -> paramTypes={boolean} (As you can see, isVarargs=true really means 0 or more args; indeed, the or function can take 0 parameter according to spec)
Example 3: n-of(integer, boolean...) -> paramTypes={integer, boolean}
- Throws:
IllegalArgumentException
- if (name == null || returnType == null
)
-
-
Method Detail
-
getName
public String getName()
Get function name- Returns:
- function name
-
getReturnType
public Datatype<RETURN_T> getReturnType()
Get function return type- Returns:
- function return type
-
isVarArgs
public boolean isVarArgs()
Returnstrue
if this method was declared to take a variable number of arguments; returnsfalse
otherwise.- Returns:
true
iff this method was declared to take a variable number of arguments.
-
getParameterTypes
public abstract List<? extends Datatype<?>> getParameterTypes()
Get function parameter types- Returns:
- function parameter types
-
-