org.thymeleaf.context.IProcessingContext Maven / Gradle / Ivy
Show all versions of org.everit.osgi.bundles.org.thymeleaf.thymeleaf Show documentation
/*
* =============================================================================
*
* Copyright (c) 2011-2013, The THYMELEAF team (http://www.thymeleaf.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
package org.thymeleaf.context;
import java.util.Map;
/**
*
* @author Daniel Fernández
*
* @since 2.0.9
*
*/
public interface IProcessingContext {
/**
*
* Returns the current context specified for template processing.
*
*
* @return the current context
*/
public IContext getContext();
/**
*
* Returns the map of expression objects that should be made available to every expression
* evaluation operation (whenever variable evaluation is available). In OGNL and SpringEL
* expressions, these will be available as #object1, #object2, etc.
*
*
* This method cannot return null, and must return a modifiable Map object (which
* will, in fact, be modified).
*
*
* @return the map of objects
*/
public Map getExpressionObjects();
/**
*
* Returns the current evaluation root. This is the object on which expressions
* (normal expressions, like those specified in the standard dialect with
* ${...}) are executed.
*
*
* @return the expression evaluation root
*/
public Object getExpressionEvaluationRoot();
/**
*
* Returns the current selection evaluation root. This is the object on which selection expressions
* (like those specified in the standard dialect with *{...}) are executed.
*
*
* @return the selection evaluation root
*/
public Object getExpressionSelectionEvaluationRoot();
/**
*
* Returns whether there currently is a selection going on
* (e.g. th:object in standard dialect).
*
*
* @return true if there is a selection currently established, false if not
*/
public boolean hasSelectionTarget();
/**
*
* Returns the selection target object, and raises an
* exception if there isn't any.
*
*
* Meant for internal use.
*
*
* @return the selection target object
*/
public Object getSelectionTarget();
/**
*
* Returns whether local variables have currently been specified or not.
* (e.g. th:with in standard dialect).
*
*
* @return true if there are local variables, false if not
*/
public boolean hasLocalVariables();
/**
*
* Returns whether a specific local variable is defined or not.
*
*
* @return true if the variable is currently defined, false if not.
*/
public boolean hasLocalVariable(final String variableName);
/**
*
* Returns the value of a local variable.
*
*
* @param variableName the name of the local variable to be returned
* @return the value of the variable, or null if the variable does not exist (or has null value)
*
*/
public Object getLocalVariable(final String variableName);
/**
*
* Returns the map of local variables.
*
*
* @return the local variables
*/
public Map getLocalVariables();
}