Package org.thymeleaf.standard.expression

Examples of org.thymeleaf.standard.expression.AssignationSequence


        final String attributeValue = element.getAttributeValue(attributeName);

        final Configuration configuration = arguments.getConfiguration();

        final AssignationSequence assignations =
                AssignationUtils.parseAssignationSequence(
                        configuration, arguments, attributeValue, false /* no parameters without value */);
        if (assignations == null) {
            throw new TemplateProcessingException(
                    "Could not parse value as attribute assignations: \"" + attributeValue + "\"");
        }

        Arguments assignationExecutionArguments = arguments;

        final Map<String,Object> newLocalVariables = new HashMap<String,Object>(assignations.size() + 1, 1.0f);
        for (final Assignation assignation : assignations) {
           
            final IStandardExpression leftExpr = assignation.getLeft();
            final Object leftValue = leftExpr.execute(configuration, assignationExecutionArguments);

View Full Code Here


       
        final String attributeValue = element.getAttributeValue(attributeName);

        final Configuration configuration = arguments.getConfiguration();

        final AssignationSequence assignations =
                AssignationUtils.parseAssignationSequence(
                    configuration, arguments, attributeValue, false /* no parameters without value */);
        if (assignations == null) {
            throw new TemplateProcessingException(
                    "Could not parse value as attribute assignations: \"" + attributeValue + "\"");
        }
       
        final Map<String,String> newAttributeValues = new HashMap<String,String>(assignations.size() + 1, 1.0f);
       
        for (final Assignation assignation : assignations) {
           
            final IStandardExpression leftExpr = assignation.getLeft();
            final Object leftValue = leftExpr.execute(configuration, arguments);
View Full Code Here

            // sort the resulting list by the configured property sorts on the tag
            if (StringUtils.isNotEmpty(sorts)) {
                Collections.sort(contentItems, new Comparator<StructuredContentDTO>() {
                    @Override
                    public int compare(StructuredContentDTO o1, StructuredContentDTO o2) {
                        AssignationSequence sortAssignments = AssignationUtils.parseAssignationSequence(arguments.getConfiguration(), arguments, sorts, false);
                        CompareToBuilder compareBuilder = new CompareToBuilder();
                        for (Assignation sortAssignment : sortAssignments) {
                            String property = sortAssignment.getLeft().getStringRepresentation();
                           
                            Object val1 = o1.getPropertyValue(property);
                            Object val2 = o2.getPropertyValue(property);
                           
                            if (sortAssignment.getRight().execute(arguments.getConfiguration(), arguments).equals("ASCENDING")) {
                                compareBuilder.append(val1, val2);
                            } else {
                                compareBuilder.append(val2, val1);
                            }
                        }
                        return compareBuilder.toComparison();
                    }
                });
            }
           
            List<Map<String, Object>> contentItemFields = new ArrayList<Map<String, Object>>();         
           
            for (StructuredContentDTO item : contentItems) {
                if (StringUtils.isNotEmpty(fieldFilters)) {
                    AssignationSequence assignments = AssignationUtils.parseAssignationSequence(arguments.getConfiguration(), arguments, fieldFilters, false);
                    boolean valid = true;
                    for (Assignation assignment : assignments) {
                       
                        if (ObjectUtils.notEqual(assignment.getRight().execute(arguments.getConfiguration(), arguments),
                                                item.getValues().get(assignment.getLeft().getStringRepresentation()))) {
View Full Code Here

TOP

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

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.