/** * <p> * Creates a new DialectAwareProcessingContext object by adding some new local variables * to the existing map (the rest of the attributes are copied verbatim). * </p> * * @param newVariables the new variables * @return the new Arguments object */ public DialectAwareProcessingContext addLocalVariables(final Map<String,Object> newVariables) { if (newVariables == null || newVariables.isEmpty()) { return this; } return new DialectAwareProcessingContext(getContext(), mergeNewLocalVariables(newVariables), getSelectionTarget(), hasSelectionTarget(), getExpressionEnhancingDialects()); }
/** * <p> * Creates a new Arguments object by setting a selection target into the processing * context, so that selection expressions are executed on it from then on. * </p> * * @param selectionTargetObject the selection target object to be set. * @return the new ProcessingContext object */ public DialectAwareProcessingContext setSelectionTarget(final Object selectionTargetObject) { return new DialectAwareProcessingContext(getContext(), getLocalVariables(), selectionTargetObject, true, getExpressionEnhancingDialects()); }
/** * <p> * Create a new TemplateProcessingParameters instance. * </p> * <p> * <b>Mainly for internal use</b>. Should not be called directly except * when processing a template (e.g. a fragment) using the {@link TemplateEngine} * from a element/attribute processor. * </p> * * @param configuration the configuration * @param templateName the template name * @param context the context */ public TemplateProcessingParameters( final Configuration configuration, final String templateName, final IContext context) { this(configuration, templateName, new DialectAwareProcessingContext(context, configuration.getDialectSet())); }
/** * <p> * Process a template. This method receives a <i>template name</i>, a <i>context</i>, a * <i>fragment specification</i> ({@link IFragmentSpec}) and also a {@link Writer}. This * method works essentially the same as {@link #process(String, IContext, Writer)} but * applying the specified fragment specification as a filter on the parsed template in order to * process only a fragment of such template. * </p> * * @param templateName the name of the template. * @param context the context. * @param fragmentSpec the fragment specification that will be applied as a filter to the parsed * template, before processing. * @param writer the writer the results will be output to. * * @since 2.0.9 */ public final void process(final String templateName, final IContext context, final IFragmentSpec fragmentSpec, final Writer writer) { process(templateName, new DialectAwareProcessingContext(context, getDialects()), fragmentSpec, writer); }
(contextObject instanceof IProcessingContext? (IProcessingContext)contextObject : new DialectAwareProcessingContext( (IContext)contextObject, templateEngine.getConfiguration().getDialects().values()));
(contextObject instanceof IProcessingContext? (IProcessingContext)contextObject : new DialectAwareProcessingContext( (IContext)contextObject, templateEngine.getConfiguration().getDialects().values()));
new SpringWebContext(request, response, servletContext , getLocale(), mergedModel, getApplicationContext()); final IProcessingContext processingContext = new DialectAwareProcessingContext(context, templateEngine.getDialects());
new SpringWebContext(request, response, servletContext , getLocale(), mergedModel, getApplicationContext()); final IProcessingContext processingContext = new DialectAwareProcessingContext(context, templateEngine.getDialects());
new SpringWebContext(request, response, servletContext , getLocale(), mergedModel, getApplicationContext()); final IProcessingContext processingContext = new DialectAwareProcessingContext(context, templateEngine.getDialects());
final IProcessingContext processingContext = new DialectAwareProcessingContext(arguments);
final IProcessingContext processingContext = new DialectAwareProcessingContext(arguments);