Package org.thymeleaf.standard.inline
Class OutputExpressionInlinePreProcessorHandler
- java.lang.Object
-
- org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler
-
- All Implemented Interfaces:
IInlinePreProcessorHandler
public final class OutputExpressionInlinePreProcessorHandler extends java.lang.Object implements IInlinePreProcessorHandler
Class in charge of performing the required event transformations on templates or fragments being parsed so that output expressions are treated as normal element-oriented parsing events.
Note this class is meant for internal use only.
- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description private char[]attributeBufferprivate char[]blockElementNameprivate static intDEFAULT_LEVELS_SIZEprivate java.lang.StringescapedTextAttributeNameprivate intexecLevelprivate java.lang.String[]inlineAttributeNamesprivate int[]inlineExecLevelsprivate intinlineIndexprivate TemplateMode[]inlineTemplateModesprivate IInlinePreProcessorHandlernextprivate java.lang.StringstandardDialectPrefixprivate java.lang.StringunescapedTextAttributeName
-
Constructor Summary
Constructors Constructor Description OutputExpressionInlinePreProcessorHandler(IEngineConfiguration configuration, TemplateMode templateMode, java.lang.String standardDialectPrefix, IInlinePreProcessorHandler handler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static TemplateModecomputeAssociatedTemplateMode(java.lang.String inlineModeAttributeValue)private static voidcountChar(int[] locator, char c)private voiddecreaseExecLevel()private static intfindNextStructureEndAvoidQuotes(char[] text, int offset, int maxi, char innerClosingChar, int[] locator)private static intfindNextStructureStart(char[] text, int offset, int maxi, int[] locator)voidhandleAttribute(char[] buffer, int nameOffset, int nameLen, int nameLine, int nameCol, int operatorOffset, int operatorLen, int operatorLine, int operatorCol, int valueContentOffset, int valueContentLen, int valueOuterOffset, int valueOuterLen, int valueLine, int valueCol)voidhandleAutoCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleAutoCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleAutoOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleAutoOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)voidhandleStandaloneElementEnd(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col)voidhandleStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col)voidhandleText(char[] buffer, int offset, int len, int line, int col)private voidincreaseExecLevel()private booleanisInlineAttribute(char[] buffer, int nameOffset, int nameLen)private static booleanmightNeedInlining(char[] buffer, int offset, int len)private voidperformInlining(char[] text, int offset, int len, int line, int col)private voidprepareAttributeBuffer(java.lang.String attributeName, char[] valueText, int valueOffset, int valueLen)private voidsetInlineTemplateMode(TemplateMode templateMode)
-
-
-
Field Detail
-
DEFAULT_LEVELS_SIZE
private static final int DEFAULT_LEVELS_SIZE
- See Also:
- Constant Field Values
-
next
private final IInlinePreProcessorHandler next
-
standardDialectPrefix
private final java.lang.String standardDialectPrefix
-
inlineAttributeNames
private final java.lang.String[] inlineAttributeNames
-
blockElementName
private final char[] blockElementName
-
escapedTextAttributeName
private final java.lang.String escapedTextAttributeName
-
unescapedTextAttributeName
private final java.lang.String unescapedTextAttributeName
-
execLevel
private int execLevel
-
inlineTemplateModes
private TemplateMode[] inlineTemplateModes
-
inlineExecLevels
private int[] inlineExecLevels
-
inlineIndex
private int inlineIndex
-
attributeBuffer
private char[] attributeBuffer
-
-
Constructor Detail
-
OutputExpressionInlinePreProcessorHandler
public OutputExpressionInlinePreProcessorHandler(IEngineConfiguration configuration, TemplateMode templateMode, java.lang.String standardDialectPrefix, IInlinePreProcessorHandler handler)
-
-
Method Detail
-
handleText
public void handleText(char[] buffer, int offset, int len, int line, int col)- Specified by:
handleTextin interfaceIInlinePreProcessorHandler
-
handleStandaloneElementStart
public void handleStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col)- Specified by:
handleStandaloneElementStartin interfaceIInlinePreProcessorHandler
-
handleStandaloneElementEnd
public void handleStandaloneElementEnd(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col)- Specified by:
handleStandaloneElementEndin interfaceIInlinePreProcessorHandler
-
handleOpenElementStart
public void handleOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleOpenElementStartin interfaceIInlinePreProcessorHandler
-
handleOpenElementEnd
public void handleOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleOpenElementEndin interfaceIInlinePreProcessorHandler
-
handleAutoOpenElementStart
public void handleAutoOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleAutoOpenElementStartin interfaceIInlinePreProcessorHandler
-
handleAutoOpenElementEnd
public void handleAutoOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleAutoOpenElementEndin interfaceIInlinePreProcessorHandler
-
handleCloseElementStart
public void handleCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleCloseElementStartin interfaceIInlinePreProcessorHandler
-
handleCloseElementEnd
public void handleCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleCloseElementEndin interfaceIInlinePreProcessorHandler
-
handleAutoCloseElementStart
public void handleAutoCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleAutoCloseElementStartin interfaceIInlinePreProcessorHandler
-
handleAutoCloseElementEnd
public void handleAutoCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)- Specified by:
handleAutoCloseElementEndin interfaceIInlinePreProcessorHandler
-
handleAttribute
public void handleAttribute(char[] buffer, int nameOffset, int nameLen, int nameLine, int nameCol, int operatorOffset, int operatorLen, int operatorLine, int operatorCol, int valueContentOffset, int valueContentLen, int valueOuterOffset, int valueOuterLen, int valueLine, int valueCol)- Specified by:
handleAttributein interfaceIInlinePreProcessorHandler
-
increaseExecLevel
private void increaseExecLevel()
-
decreaseExecLevel
private void decreaseExecLevel()
-
isInlineAttribute
private boolean isInlineAttribute(char[] buffer, int nameOffset, int nameLen)
-
setInlineTemplateMode
private void setInlineTemplateMode(TemplateMode templateMode)
-
computeAssociatedTemplateMode
private static TemplateMode computeAssociatedTemplateMode(java.lang.String inlineModeAttributeValue)
-
mightNeedInlining
private static boolean mightNeedInlining(char[] buffer, int offset, int len)
-
performInlining
private void performInlining(char[] text, int offset, int len, int line, int col)
-
countChar
private static void countChar(int[] locator, char c)
-
findNextStructureStart
private static int findNextStructureStart(char[] text, int offset, int maxi, int[] locator)
-
findNextStructureEndAvoidQuotes
private static int findNextStructureEndAvoidQuotes(char[] text, int offset, int maxi, char innerClosingChar, int[] locator)
-
prepareAttributeBuffer
private void prepareAttributeBuffer(java.lang.String attributeName, char[] valueText, int valueOffset, int valueLen)
-
-