Package com.aspectran.core.context.expr
Class TokenEvaluation
java.lang.Object
com.aspectran.core.context.expr.TokenEvaluation
- All Implemented Interfaces:
TokenEvaluator
- Direct Known Subclasses:
ItemEvaluation
The Class TokenEvaluation.
Created: 2008. 03. 29 AM 12:59:16
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluateAsList
(List<Token[]> tokensList) evaluateAsMap
(Map<String, Token[]> tokensMap) evaluateAsProperties
(Properties tokensProp) evaluateAsSet
(Set<Token[]> tokensSet) evaluateAsString
(Token[] tokens) protected Object
getAttribute
(Token token) Returns the value of the named attribute as anObject
of the activity's request attributes or action results.protected Object
Returns the bean instance that matches the given token.protected Object
getBeanProperty
(Object bean, String propertyName) Return the value of the specified property of the specified bean.protected FileParameter
getFileParameter
(String name) Returns aFileParameter
object as a given activity's request parameter name, ornull
if the parameter does not exist.protected FileParameter[]
getFileParameterValues
(String name) Returns an array ofFileParameter
objects containing all of the values the given activity's request parameter has, ornull
if the parameter does not exist.protected String
getParameter
(String name) Returns the value of an activity's request parameter as aString
, ornull
if the parameter does not exist.protected String[]
getParameterValues
(String name) Returns an array ofString
objects containing all of the values the given activity's request parameter has, ornull
if the parameter does not exist.protected Object
getProperty
(Token token) Returns an Environment variable that matches the given token.protected String
getTemplate
(Token token) Executes template, returns the generated output.
-
Field Details
-
activity
-
-
Constructor Details
-
TokenEvaluation
Instantiates a new TokenEvaluation.- Parameters:
activity
- the current Activity
-
-
Method Details
-
getActivity
- Specified by:
getActivity
in interfaceTokenEvaluator
-
evaluate
- Specified by:
evaluate
in interfaceTokenEvaluator
-
evaluate
- Specified by:
evaluate
in interfaceTokenEvaluator
-
evaluate
- Specified by:
evaluate
in interfaceTokenEvaluator
- Throws:
IOException
-
evaluateAsString
- Specified by:
evaluateAsString
in interfaceTokenEvaluator
-
evaluateAsList
- Specified by:
evaluateAsList
in interfaceTokenEvaluator
-
evaluateAsSet
- Specified by:
evaluateAsSet
in interfaceTokenEvaluator
-
evaluateAsMap
- Specified by:
evaluateAsMap
in interfaceTokenEvaluator
-
evaluateAsProperties
- Specified by:
evaluateAsProperties
in interfaceTokenEvaluator
-
getParameter
Returns the value of an activity's request parameter as aString
, ornull
if the parameter does not exist.- Parameters:
name
- aString
specifying the name of the parameter- Returns:
- a
String
representing the single value of the parameter
-
getParameterValues
Returns an array ofString
objects containing all of the values the given activity's request parameter has, ornull
if the parameter does not exist.- Parameters:
name
- aString
specifying the name of the parameter- Returns:
- an array of
String
objects containing the parameter's values
-
getFileParameter
Returns aFileParameter
object as a given activity's request parameter name, ornull
if the parameter does not exist.- Parameters:
name
- aString
specifying the name of the parameter- Returns:
- a
FileParameter
representing the single value of the parameter
-
getFileParameterValues
Returns an array ofFileParameter
objects containing all of the values the given activity's request parameter has, ornull
if the parameter does not exist.- Parameters:
name
- aString
specifying the name of the parameter- Returns:
- an array of
FileParameter
objects containing the parameter's values
-
getAttribute
Returns the value of the named attribute as anObject
of the activity's request attributes or action results.- Parameters:
token
- the token- Returns:
- an
Object
containing the value of the attribute, ornull
if the attribute does not exist
-
getBean
Returns the bean instance that matches the given token.- Parameters:
token
- the token- Returns:
- an instance of the bean
-
getBeanProperty
Return the value of the specified property of the specified bean.- Parameters:
bean
- the bean objectpropertyName
- the property name- Returns:
- the object
-
getProperty
Returns an Environment variable that matches the given token.%{classpath:/com/aspectran/sample.properties} %{classpath:/com/aspectran/sample.properties^propertyName:defaultValue}
- Parameters:
token
- the token- Returns:
- an environment variable
- Throws:
IOException
- if an I/O error has occurred
-
getTemplate
Executes template, returns the generated output.- Parameters:
token
- the token- Returns:
- the generated output as
String
-