Interface BroadleafTemplateContext
public interface BroadleafTemplateContext
Utility class to be used to do various functions on and around the template
- Author:
- Jay Aisenbrey (cja769)
-
Method Summary
Modifier and TypeMethodDescriptioncreateNonVoidElement(String tagName) createNonVoidElement(String tagName, Map<String, String> attributes, boolean useDoubleQuotes) createStandaloneElement(String tagName) createStandaloneElement(String tagName, Map<String, String> attributes, boolean useDoubleQuotes) createTextElement(String text) getAssignationSequence(String value, boolean allowParametersWithoutValue) getBindStatus(String attributeValue) jakarta.servlet.http.HttpServletRequestgetVariable(String name) <T> TparseExpression(String value) voidsetNodeLocalVariable(BroadleafTemplateElement element, String key, Object value) Sets a variable on the givenelementvoidsetNodeLocalVariables(BroadleafTemplateElement element, Map<String, Object> variableMap) Sets a map of variables on the giveelement
-
Method Details
-
parseExpression
- Returns:
- The object that the
valueevaluates to using the underlying template language
-
getAssignationSequence
List<BroadleafAssignation> getAssignationSequence(String value, boolean allowParametersWithoutValue) - Parameters:
allowParametersWithoutValue- true if assignations where the key has no value assigning to it is valid- Returns:
- The list of
BroadleafAssignations that were evaluated fromvalue
-
createNonVoidElement
BroadleafTemplateNonVoidElement createNonVoidElement(String tagName, Map<String, String> attributes, boolean useDoubleQuotes) - Parameters:
tagName- The name of the tag that is being createdattributes- The attributes that should be added to the taguseDoubleQuotes- True if the attribute values should be surrounded by double quotes and false if they should use single quotes
-
createNonVoidElement
- Parameters:
tagName- The name of the tag that is being created
-
createStandaloneElement
BroadleafTemplateElement createStandaloneElement(String tagName, Map<String, String> attributes, boolean useDoubleQuotes) - Parameters:
tagName- The name of the tag that is being createdattributes- The attributes that should be added to the taguseDoubleQuotes- True if the attribute values should be surrounded by double quotes and false if they should use single quotes
-
createStandaloneElement
- Parameters:
tagName- The name of the tag that is being created
-
createTextElement
- Parameters:
text- The text that theBroadleafTemplateElementshould represent
-
createModel
BroadleafTemplateModel createModel()- Returns:
- A new
BroadleafTemplateModelthat can have elements added to it to make a snippet of markup
-
setNodeLocalVariable
Sets a variable on the givenelement -
setNodeLocalVariables
Sets a map of variables on the giveelement -
getVariable
- Returns:
- The object on the current variable model whose key was
name
-
getBindStatus
- Returns:
- Gets the current Spring
BindStatusforattributeValue
-
getRequest
jakarta.servlet.http.HttpServletRequest getRequest()- Returns:
- The current HttpServletRequest if it exists or null otherwise
-