| java.lang.Object org.gomba.Expression
Expression | final class Expression (Code) | | An Expression is created from a string containing ${} parameters. The
expression is evaluated by the replaceParameters method.
A ${} parameter has the following syntax:
domain.paramName JavaType defaultValue . JavaType and
defaultValue are optional.
Examples:
${param.myParam}
${param.myParam java.lang.Integer}
${param.myParam java.lang.Integer 10}
${path.1}
${column.myColumn java.util.Date}
author: Flavio Tordini version: $Id: Expression.java,v 1.4 2004/11/29 17:27:38 flaviotordini Exp $ |
Method Summary | |
public static void | parseParameters(String expression, Vector fragments, Vector parameters) Parse parameters. | public Object | replaceParameters(ParameterResolver parameterResolver) Replaces ${domain.paramName} expressions in the given
query definition with the actual values.
Parameters: parameterResolver - The object used to resolve parameters exception: Exception - if the string contains an opening ${ without a closing } the original string with the properties replaced by questionmarks. |
parseParameters | public static void parseParameters(String expression, Vector fragments, Vector parameters) throws Exception(Code) | | Parse parameters. Fill the fragments with string literals and parameters
with ParameterDefinition objects. For each parameter a
null value is placed is the fragments vector and viceversa.
|
replaceParameters | public Object replaceParameters(ParameterResolver parameterResolver) throws Exception(Code) | | Replaces ${domain.paramName} expressions in the given
query definition with the actual values.
Parameters: parameterResolver - The object used to resolve parameters exception: Exception - if the string contains an opening ${ without a closing } the original string with the properties replaced by questionmarks. If the original string contains only a ${} parameter, thetyped value of that parameter is returned, otherwise aString is returned. |
|
|