Package org.thymeleaf.standard.expression

Examples of org.thymeleaf.standard.expression.IStandardExpression


        final Configuration configuration = arguments.getConfiguration();

        final Each each = EachUtils.parseEach(configuration, arguments, attributeValue);

        final IStandardExpression iterVarExpr = each.getIterVar();
        final Object iterVarValue = iterVarExpr.execute(configuration, arguments);

        final IStandardExpression statusVarExpr = each.getStatusVar();
        final Object statusVarValue;
        if (statusVarExpr != null) {
            statusVarValue = statusVarExpr.execute(configuration, arguments);
        } else {
            statusVarValue = null;
        }

        final IStandardExpression iterableExpr = each.getIterable();
        final Object iteratedValue = iterableExpr.execute(configuration, arguments);

        final String iterVarName = (iterVarValue == null? null : iterVarValue.toString());
        if (StringUtils.isEmptyOrWhitespace(iterVarName)) {
            throw new TemplateProcessingException(
                    "Iteration variable name expression evaluated as null: \"" + iterVarExpr + "\"");
View Full Code Here


        final Configuration configuration = arguments.getConfiguration();
        final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

        final String attributeValue = element.getAttributeValue(attributeName);
        final IStandardExpression expression = expressionParser.parseExpression(configuration, arguments, attributeValue);
        final Object value = expression.execute(configuration, arguments);

        return EvaluationUtil.evaluateAsBoolean(value);
       
    }
View Full Code Here

        final String attributeValue = element.getAttributeValue(attributeName);

        final Configuration configuration = arguments.getConfiguration();
        final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

        final IStandardExpression expression = expressionParser.parseExpression(configuration, arguments, attributeValue);

        final Object result = expression.execute(configuration, arguments);
        return (result == null? "" : result.toString());

    }
View Full Code Here

      final String attributeValue = theElement.getAttributeValue(theAttributeName);

      final Configuration configuration = theArguments.getConfiguration();
      final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

      final IStandardExpression expression = expressionParser.parseExpression(configuration, theArguments, attributeValue);
      final Object value = expression.execute(configuration, theArguments);
     
      theElement.removeAttribute(theAttributeName);
      theElement.clearChildren();

      if (value == null) {
View Full Code Here

        final String attributeValue = element.getAttributeValue(attributeName);

        final Configuration configuration = arguments.getConfiguration();
        final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

        final IStandardExpression expression = expressionParser.parseExpression(configuration, arguments, attributeValue);

        final Object result =
                expression.execute(configuration, arguments, StandardExpressionExecutionContext.UNESCAPED_EXPRESSION);

        return (result == null? "" : result.toString());

    }
View Full Code Here

      final String attributeValue = theElement.getAttributeValue(theAttributeName);

      final Configuration configuration = theArguments.getConfiguration();
      final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

      final IStandardExpression expression = expressionParser.parseExpression(configuration, theArguments, attributeValue);
      final Object value = expression.execute(configuration, theArguments);

      theElement.removeAttribute(theAttributeName);
      theElement.clearChildren();

      if (value == null) {
View Full Code Here

      final String attributeValue = theElement.getAttributeValue(theAttributeName);

      final Configuration configuration = theArguments.getConfiguration();
      final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

      final IStandardExpression expression = expressionParser.parseExpression(configuration, theArguments, attributeValue);
      final Object value = expression.execute(configuration, theArguments);


      theElement.removeAttribute(theAttributeName);
      theElement.clearChildren();
View Full Code Here

      final String attributeValue = theElement.getAttributeValue(theAttributeName);

      final Configuration configuration = theArguments.getConfiguration();
      final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

      final IStandardExpression expression = expressionParser.parseExpression(configuration, theArguments, attributeValue);
      final Object value = expression.execute(configuration, theArguments);


      theElement.removeAttribute(theAttributeName);
      theElement.clearChildren();
View Full Code Here

    Arguments withExecutionArguments = arguments;

    for (Attribute attribute : attributeMap.values()) {
      if (dialectPrefix.equals(Attribute.getPrefixFromAttributeName(attribute.getNormalizedName()))) {
        final String newVariableName = Attribute.getUnprefixedAttributeName(attribute.getOriginalName());
        final IStandardExpression expression = expressionParser.parseExpression(arguments.getConfiguration(),
            withExecutionArguments, attribute.getValue());
        final Object newVariableValue = expression.execute(configuration, withExecutionArguments);
        withExecutionArguments = withExecutionArguments.addLocalVariables(Collections.singletonMap(newVariableName,
            newVariableValue));
        newLocalVariables.put(newVariableName, newVariableValue);
        element.removeAttribute(attribute.getNormalizedName());
      }
View Full Code Here

      final String attributeValue = theElement.getAttributeValue(theAttributeName);

      final Configuration configuration = theArguments.getConfiguration();
      final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

      final IStandardExpression expression = expressionParser.parseExpression(configuration, theArguments, attributeValue);
      final Object value = expression.execute(configuration, theArguments);
     
      theElement.removeAttribute(theAttributeName);
      theElement.clearChildren();

      if (value == null) {
View Full Code Here

TOP

Related Classes of org.thymeleaf.standard.expression.IStandardExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.