Class DecoupledTemplateLogicBuilderMarkupHandler
- java.lang.Object
-
- org.attoparser.AbstractMarkupHandler
-
- org.thymeleaf.templateparser.markup.decoupled.DecoupledTemplateLogicBuilderMarkupHandler
-
- All Implemented Interfaces:
org.attoparser.IAttributeSequenceHandler,org.attoparser.ICDATASectionHandler,org.attoparser.ICommentHandler,org.attoparser.IDocTypeHandler,org.attoparser.IDocumentHandler,org.attoparser.IElementHandler,org.attoparser.IMarkupHandler,org.attoparser.IProcessingInstructionHandler,org.attoparser.ITextHandler,org.attoparser.IXMLDeclarationHandler
public final class DecoupledTemplateLogicBuilderMarkupHandler extends org.attoparser.AbstractMarkupHandlerImplementation of
IMarkupHandlerused for building and populating instances ofDecoupledTemplateLogicas a result of parsing a decoupled template logic resource.Once built and populated, instances of
DecoupledTemplateLogicare handled over toTemplateHandlerAdapterMarkupHandlerinstances which are one of the steps in the template parsing chain (converting parser events intoITemplateHandlerevents). Attributes specified here to be injected into the template are injected at real-time during the parsing operation itself, so that overhead is minimal (and zero once the template is cached).- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDecoupledTemplateLogicBuilderMarkupHandler.Selector
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTRIBUTE_NAME_SELprivate static char[]ATTRIBUTE_NAME_SEL_CHARSprivate java.util.List<DecoupledInjectedAttribute>currentInjectedAttributesprivate DecoupledTemplateLogicdecoupledTemplateLogicprivate booleaninAttrTagprivate booleaninLogicBodyprivate DecoupledTemplateLogicBuilderMarkupHandler.Selectorselectorstatic java.lang.StringTAG_NAME_ATTRprivate static char[]TAG_NAME_ATTR_CHARSstatic java.lang.StringTAG_NAME_LOGICprivate static char[]TAG_NAME_LOGIC_CHARSprivate TemplateModetemplateModeprivate java.lang.StringtemplateName
-
Constructor Summary
Constructors Constructor Description DecoupledTemplateLogicBuilderMarkupHandler(java.lang.String templateName, TemplateMode templateMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DecoupledTemplateLogicgetDecoupledTemplateLogic()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)voidhandleCloseElementEnd(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)-
Methods inherited from class org.attoparser.AbstractMarkupHandler
handleAutoCloseElementStart, handleAutoOpenElementEnd, handleAutoOpenElementStart, handleCDATASection, handleCloseElementStart, handleComment, handleDocType, handleDocumentEnd, handleDocumentStart, handleInnerWhiteSpace, handleProcessingInstruction, handleText, handleUnmatchedCloseElementEnd, handleUnmatchedCloseElementStart, handleXmlDeclaration, setParseConfiguration, setParseSelection, setParseStatus
-
-
-
-
Field Detail
-
TAG_NAME_LOGIC
public static final java.lang.String TAG_NAME_LOGIC
- See Also:
- Constant Field Values
-
TAG_NAME_ATTR
public static final java.lang.String TAG_NAME_ATTR
- See Also:
- Constant Field Values
-
ATTRIBUTE_NAME_SEL
public static final java.lang.String ATTRIBUTE_NAME_SEL
- See Also:
- Constant Field Values
-
TAG_NAME_LOGIC_CHARS
private static final char[] TAG_NAME_LOGIC_CHARS
-
TAG_NAME_ATTR_CHARS
private static final char[] TAG_NAME_ATTR_CHARS
-
ATTRIBUTE_NAME_SEL_CHARS
private static final char[] ATTRIBUTE_NAME_SEL_CHARS
-
templateName
private final java.lang.String templateName
-
templateMode
private final TemplateMode templateMode
-
decoupledTemplateLogic
private final DecoupledTemplateLogic decoupledTemplateLogic
-
inLogicBody
private boolean inLogicBody
-
inAttrTag
private boolean inAttrTag
-
selector
private DecoupledTemplateLogicBuilderMarkupHandler.Selector selector
-
currentInjectedAttributes
private java.util.List<DecoupledInjectedAttribute> currentInjectedAttributes
-
-
Constructor Detail
-
DecoupledTemplateLogicBuilderMarkupHandler
public DecoupledTemplateLogicBuilderMarkupHandler(java.lang.String templateName, TemplateMode templateMode)
-
-
Method Detail
-
getDecoupledTemplateLogic
public DecoupledTemplateLogic getDecoupledTemplateLogic()
-
handleStandaloneElementStart
public void handleStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col) throws org.attoparser.ParseException- Specified by:
handleStandaloneElementStartin interfaceorg.attoparser.IElementHandler- Overrides:
handleStandaloneElementStartin classorg.attoparser.AbstractMarkupHandler- Throws:
org.attoparser.ParseException
-
handleStandaloneElementEnd
public void handleStandaloneElementEnd(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col) throws org.attoparser.ParseException- Specified by:
handleStandaloneElementEndin interfaceorg.attoparser.IElementHandler- Overrides:
handleStandaloneElementEndin classorg.attoparser.AbstractMarkupHandler- Throws:
org.attoparser.ParseException
-
handleOpenElementStart
public void handleOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws org.attoparser.ParseException- Specified by:
handleOpenElementStartin interfaceorg.attoparser.IElementHandler- Overrides:
handleOpenElementStartin classorg.attoparser.AbstractMarkupHandler- Throws:
org.attoparser.ParseException
-
handleOpenElementEnd
public void handleOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws org.attoparser.ParseException- Specified by:
handleOpenElementEndin interfaceorg.attoparser.IElementHandler- Overrides:
handleOpenElementEndin classorg.attoparser.AbstractMarkupHandler- Throws:
org.attoparser.ParseException
-
handleCloseElementEnd
public void handleCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws org.attoparser.ParseException- Specified by:
handleCloseElementEndin interfaceorg.attoparser.IElementHandler- Overrides:
handleCloseElementEndin classorg.attoparser.AbstractMarkupHandler- Throws:
org.attoparser.ParseException
-
handleAutoCloseElementEnd
public void handleAutoCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws org.attoparser.ParseException- Specified by:
handleAutoCloseElementEndin interfaceorg.attoparser.IElementHandler- Overrides:
handleAutoCloseElementEndin classorg.attoparser.AbstractMarkupHandler- Throws:
org.attoparser.ParseException
-
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) throws org.attoparser.ParseException- Specified by:
handleAttributein interfaceorg.attoparser.IAttributeSequenceHandler- Overrides:
handleAttributein classorg.attoparser.AbstractMarkupHandler- Throws:
org.attoparser.ParseException
-
-