Package org.thymeleaf.standard.expression

Examples of org.thymeleaf.standard.expression.IStandardExpressionParser


    @Override
    protected final boolean isVisible(
            final Arguments arguments, final Element element, final String attributeName) {

        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 Arguments arguments, final Element element, final String attributeName) {

        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

    @Override
    protected ProcessorResult processAttribute(Arguments theArguments, Element theElement, String theAttributeName) {
      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

    protected final String getText(final Arguments arguments, final Element element, final String attributeName) {

        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

    @Override
    protected ProcessorResult processAttribute(Arguments theArguments, Element theElement, String theAttributeName) {
      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

    @Override
    protected ProcessorResult processAttribute(Arguments theArguments, Element theElement, String theAttributeName) {
      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

    @Override
    protected ProcessorResult processAttribute(Arguments theArguments, Element theElement, String theAttributeName) {
      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

    Element element = ((Element) node);
    Map<String, Attribute> attributeMap = element.getAttributeMap();
    String dialectPrefix = processorMatchingContext.getDialectPrefix();

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

    final Map<String, Object> newLocalVariables = new HashMap<String, Object>(1, 1.0f);

    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);
View Full Code Here

    @Override
    protected ProcessorResult processAttribute(Arguments theArguments, Element theElement, String theAttributeName) {
      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

TOP

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

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.