/** * <p> * Returns the current context specified for template processing. * </p> * <p> * Equivalent to <tt>getProcessingContext().getContext()</tt>. * </p> * * @return the current context */ public IContext getContext() { return this.processingContext.getContext(); }
protected Map<String, Object> computeAdditionalContextVariables(IProcessingContext processingContext) { Map<String, Object> var = new HashMap<>(); var.put(Routes.OBJECT_NAME, processingContext.getContext().getVariables().get(Routes.ROUTES_VAR)); final Context context = Context.CONTEXT.get(); if (context != null) { var.put("http", context); var.put("session", context.session()); var.put("flash", context.flash()); var.put("request", context.request()); var.put("parameters", context.parameters()); } return var; }
public DialectAwareProcessingContext( final IProcessingContext processingContext, final Collection<? extends IDialect> dialects) { super((processingContext == null? null : processingContext.getContext()), (processingContext == null? null : processingContext.getLocalVariables()), (processingContext == null? null : processingContext.getSelectionTarget()), (processingContext != null && processingContext.hasSelectionTarget()), dialects); Validate.notNull(processingContext, "Processing context cannot be null"); }
public ProcessingContext(final IProcessingContext processingContext) { super((processingContext == null? null : processingContext.getContext()), (processingContext == null? null : processingContext.getLocalVariables()), (processingContext == null? null : processingContext.getSelectionTarget()), (processingContext != null && processingContext.hasSelectionTarget())); Validate.notNull(processingContext, "Processing context cannot be null"); }
final IContext context = processingContext.getContext();
if (!isWebContext(processingContext.getContext()) && !isLinkBaseAbsolute(linkBase) && !isLinkBaseServerRelative(linkBase)) { throw new TemplateProcessingException( "Link base \"" + linkBase + "\" cannot be context relative (/) or page relative unless you implement the " + IWebContext.class.getName() + " interface (context is of class: " + processingContext.getContext().getClass().getName() + ")"); if (!isWebContext(processingContext.getContext())) { final IWebContext webContext = (IWebContext) processingContext.getContext();
Validate.notNull(processingContext, "Processing context cannot be null"); final IContext context = processingContext.getContext();