public Object convert(final Object target, final Class<?> clazz) { final IStandardConversionService conversionService = StandardExpressions.getConversionService(this.context.getConfiguration()); return conversionService.convert(this.context, target, clazz); }
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); if (!(expressionParser instanceof StandardExpressionParser)) {
public Object execute( final IExpressionContext context, final StandardExpressionExecutionContext expContext) { Validate.notNull(context, "Context cannot be null"); final IStandardVariableExpressionEvaluator variableExpressionEvaluator = StandardExpressions.getVariableExpressionEvaluator(context.getConfiguration()); final Object result = execute(context, this, variableExpressionEvaluator, expContext); return LiteralValue.unwrap(result); }
static IStandardExpression parseExpression( final IExpressionContext context, final String input, final boolean preprocess) { final IEngineConfiguration configuration = context.getConfiguration(); final String preprocessedInput = (preprocess? StandardExpressionPreprocessor.preprocess(context, input) : input); final IStandardExpression cachedExpression = ExpressionCache.getExpressionFromCache(configuration, preprocessedInput); if (cachedExpression != null) { return cachedExpression; } final Expression expression = Expression.parse(preprocessedInput.trim()); if (expression == null) { throw new TemplateProcessingException("Could not parse as expression: \"" + input + "\""); } ExpressionCache.putExpressionIntoCache(configuration, preprocessedInput, expression); return expression; }
public static AssignationSequence parseAssignationSequence( final IExpressionContext context, final String input, final boolean allowParametersWithoutValue) { Validate.notNull(context, "Context cannot be null"); Validate.notNull(input, "Input cannot be null"); final String preprocessedInput = StandardExpressionPreprocessor.preprocess(context, input); final IEngineConfiguration configuration = context.getConfiguration(); if (configuration != null) { final AssignationSequence cachedAssignationSequence = ExpressionCache.getAssignationSequenceFromCache(configuration, preprocessedInput); if (cachedAssignationSequence != null) { return cachedAssignationSequence; } } final AssignationSequence assignationSequence = internalParseAssignationSequence(preprocessedInput.trim(), allowParametersWithoutValue); if (assignationSequence == null) { throw new TemplateProcessingException("Could not parse as assignation sequence: \"" + input + "\""); } if (configuration != null) { ExpressionCache.putAssignationSequenceIntoCache(configuration, preprocessedInput, assignationSequence); } return assignationSequence; }
public static ExpressionSequence parseExpressionSequence( final IExpressionContext context, final String input) { Validate.notNull(context, "Context cannot be null"); Validate.notNull(input, "Input cannot be null"); final String preprocessedInput = StandardExpressionPreprocessor.preprocess(context, input); final IEngineConfiguration configuration = context.getConfiguration(); if (configuration != null) { final ExpressionSequence cachedExpressionSequence = ExpressionCache.getExpressionSequenceFromCache(configuration, preprocessedInput); if (cachedExpressionSequence != null) { return cachedExpressionSequence; } } final ExpressionSequence expressionSequence = internalParseExpressionSequence(preprocessedInput.trim()); if (expressionSequence == null) { throw new TemplateProcessingException("Could not parse as expression sequence: \"" + input + "\""); } if (configuration != null) { ExpressionCache.putExpressionSequenceIntoCache(configuration, preprocessedInput, expressionSequence); } return expressionSequence; }
public static Each parseEach( final IExpressionContext context, final String input) { Validate.notNull(context, "Context cannot be null"); Validate.notNull(input, "Input cannot be null"); final String preprocessedInput = StandardExpressionPreprocessor.preprocess(context, input); final IEngineConfiguration configuration = context.getConfiguration(); if (configuration != null) { final Each cachedEach = ExpressionCache.getEachFromCache(configuration, preprocessedInput); if (cachedEach != null) { return cachedEach; } } final Each each = internalParseEach(preprocessedInput.trim()); if (each == null) { throw new TemplateProcessingException("Could not parse as each: \"" + input + "\""); } if (configuration != null) { ExpressionCache.putEachIntoCache(configuration, preprocessedInput, each); } return each; }
StandardExpressions.getVariableExpressionEvaluator(context.getConfiguration());
final IEngineConfiguration configuration = context.getConfiguration();
public static Object evaluate(IExpressionContext context, String expressionValue) { final String value = String.valueOf(expressionValue).trim(); final IStandardExpressionParser expressionParser = StandardExpressions .getExpressionParser(context.getConfiguration()); final IStandardExpression expression = expressionParser.parseExpression(context, value); return expression.execute(context); }
public static Object evaluate(IExpressionContext context, String expressionValue) { final String value = String.valueOf(expressionValue).trim(); final IStandardExpressionParser expressionParser = StandardExpressions .getExpressionParser(context.getConfiguration()); final IStandardExpression expression = expressionParser.parseExpression(context, value); return expression.execute(context); }
public static IThymeleafBindStatus getBindStatus( final IExpressionContext context, final boolean optional, final String expression) { Validate.notNull(expression, "Expression cannot be null"); if (GLOBAL_EXPRESSION.equals(expression) || ALL_EXPRESSION.equals(expression) || ALL_FIELDS.equals(expression)) { // If "global", "all" or "*" are used without prefix, they must be inside a form, so we add *{...} final String completeExpression = "*{" + expression + "}"; return getBindStatus(context, optional, completeExpression); } final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); final IStandardExpression expressionObj = expressionParser.parseExpression(context, expression); if (expressionObj == null) { throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: cannot perform Spring bind"); } if (expressionObj instanceof SelectionVariableExpression) { final String bindExpression = ((SelectionVariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, true, bindExpression); } if (expressionObj instanceof VariableExpression) { final String bindExpression = ((VariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, false, bindExpression); } throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: only variable expressions ${...} or " + "selection expressions *{...} are allowed in Spring field bindings"); }
public static BindStatus getBindStatus( final IExpressionContext context, final boolean optional, final String expression) { Validate.notNull(expression, "Expression cannot be null"); if (GLOBAL_EXPRESSION.equals(expression) || ALL_EXPRESSION.equals(expression) || ALL_FIELDS.equals(expression)) { // If "global", "all" or "*" are used without prefix, they must be inside a form, so we add *{...} final String completeExpression = "*{" + expression + "}"; return getBindStatus(context, optional, completeExpression); } final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); final IStandardExpression expressionObj = expressionParser.parseExpression(context, expression); if (expressionObj == null) { throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: cannot perform Spring bind"); } if (expressionObj instanceof SelectionVariableExpression) { final String bindExpression = ((SelectionVariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, true, bindExpression); } if (expressionObj instanceof VariableExpression) { final String bindExpression = ((VariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, false, bindExpression); } throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: only variable expressions ${...} or " + "selection expressions *{...} are allowed in Spring field bindings"); }
public static BindStatus getBindStatus( final IExpressionContext context, final boolean optional, final String expression) { Validate.notNull(expression, "Expression cannot be null"); if (GLOBAL_EXPRESSION.equals(expression) || ALL_EXPRESSION.equals(expression) || ALL_FIELDS.equals(expression)) { // If "global", "all" or "*" are used without prefix, they must be inside a form, so we add *{...} final String completeExpression = "*{" + expression + "}"; return getBindStatus(context, optional, completeExpression); } final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); final IStandardExpression expressionObj = expressionParser.parseExpression(context, expression); if (expressionObj == null) { throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: cannot perform Spring bind"); } if (expressionObj instanceof SelectionVariableExpression) { final String bindExpression = ((SelectionVariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, true, bindExpression); } if (expressionObj instanceof VariableExpression) { final String bindExpression = ((VariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, false, bindExpression); } throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: only variable expressions ${...} or " + "selection expressions *{...} are allowed in Spring field bindings"); }
public static BindStatus getBindStatus( final IExpressionContext context, final boolean optional, final String expression) { Validate.notNull(expression, "Expression cannot be null"); if (GLOBAL_EXPRESSION.equals(expression) || ALL_EXPRESSION.equals(expression) || ALL_FIELDS.equals(expression)) { // If "global", "all" or "*" are used without prefix, they must be inside a form, so we add *{...} final String completeExpression = "*{" + expression + "}"; return getBindStatus(context, optional, completeExpression); } final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); final IStandardExpression expressionObj = expressionParser.parseExpression(context, expression); if (expressionObj == null) { throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: cannot perform Spring bind"); } if (expressionObj instanceof SelectionVariableExpression) { final String bindExpression = ((SelectionVariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, true, bindExpression); } if (expressionObj instanceof VariableExpression) { final String bindExpression = ((VariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, false, bindExpression); } throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: only variable expressions ${...} or " + "selection expressions *{...} are allowed in Spring field bindings"); }
public static BindStatus getBindStatus( final IExpressionContext context, final boolean optional, final String expression) { Validate.notNull(expression, "Expression cannot be null"); if (GLOBAL_EXPRESSION.equals(expression) || ALL_EXPRESSION.equals(expression) || ALL_FIELDS.equals(expression)) { // If "global", "all" or "*" are used without prefix, they must be inside a form, so we add *{...} final String completeExpression = "*{" + expression + "}"; return getBindStatus(context, optional, completeExpression); } final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); final IStandardExpression expressionObj = expressionParser.parseExpression(context, expression); if (expressionObj == null) { throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: cannot perform Spring bind"); } if (expressionObj instanceof SelectionVariableExpression) { final String bindExpression = ((SelectionVariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, true, bindExpression); } if (expressionObj instanceof VariableExpression) { final String bindExpression = ((VariableExpression)expressionObj).getExpression(); return getBindStatusFromParsedExpression(context, optional, false, bindExpression); } throw new TemplateProcessingException( "Expression \"" + expression + "\" is not valid: only variable expressions ${...} or " + "selection expressions *{...} are allowed in Spring field bindings"); }
final IEngineConfiguration configuration = context.getConfiguration();
final IEngineConfiguration configuration = context.getConfiguration();
final IEngineConfiguration configuration = context.getConfiguration();
final IEngineConfiguration configuration = context.getConfiguration();