Package org.thymeleaf.processor

Examples of org.thymeleaf.processor.ProcessorResult


    HttpServletRequest request = ((IWebContext) arguments.getContext()).getHttpServletRequest();
    HttpServletResponse response = ((IWebContext) arguments.getContext()).getHttpServletResponse();
    HtmlTable htmlTable = (HtmlTable) RequestUtils.getFromRequest(DataTablesDialect.INTERNAL_BEAN_TABLE, request);

    ProcessorResult processorResult = doProcessElement(arguments, element, request, response, htmlTable);
    return processorResult;
  }
View Full Code Here


                    // the processor is executed
                    final int nodeLocalVariablesHashBefore =
                            (node.nodeLocalVariables == null? -1 : node.nodeLocalVariables.contentsHash());
                   
                    // Execute processor
                    final ProcessorResult processorResult =
                            processor.getProcessor().process(executionArguments, processor.getContext(), node);

                    // Obtain a "hash snapshot" of the node local variables map after
                    // the processor has been executed
                    final int nodeLocalVariablesHashAfter =
                            (node.nodeLocalVariables == null? -1 : node.nodeLocalVariables.contentsHash());

                    // Check whether the processor just modified the node variables map. This
                    // is done BEFORE processorResult.computeNewArguments(...) so that variables
                    // set from the ProcessorResult have higher priority (i.e. can override) variables
                    // set directly into the nodeLocalVariables map.
                    if (nodeLocalVariablesHashBefore != nodeLocalVariablesHashAfter) {
                        executionArguments = executionArguments.addLocalVariables(node.nodeLocalVariables);
                    }
                   
                    // The execution arguments need to be updated as instructed by the processor
                    // (for example, for adding local variables)
                    executionArguments = processorResult.computeNewArguments(executionArguments);

                    // Using only the Arguments object for keeping track of whether the text/comment nodes had to be
                    // computed or not is not a good option because such information dissapears if the node
                    // setting these flags dissapears afterwards (because of a "remove", for instance).
                    if (processorResult.isProcessTextNodesSet()) {
                        node.setProcessTextNodes(processorResult.getProcessTextNodes());
                    }
                    if (processorResult.isProcessCommentNodesSet()) {
                        node.setProcessCommentNodes(processorResult.getProcessCommentNodes());
                    }

                    // If we have added local variables, we should update the node's map for these variables in
                    // order to keep them synchronized
                    if ((processorResult.hasLocalVariables() || processorResult.isSelectionTargetSet()) && executionArguments.hasLocalVariables()) {
                        node.unsafeSetNodeLocalVariables(executionArguments.getLocalVariables());
                    }
                   
                    // Make sure this specific processor instance is not executed again
                    alreadyExecuted.count(processor);
View Full Code Here

    super(attributeName);
  }

  @Override
  protected ProcessorResult processAttribute(Arguments arguments, Element element, String attributeName) {
    ProcessorResult processorResult = doProcessAttribute(arguments, element, attributeName);
    element.removeAttribute(attributeName);
    return processorResult;
  }
View Full Code Here

TOP

Related Classes of org.thymeleaf.processor.ProcessorResult

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.