Class Processor
- java.lang.Object
-
- org.devacfr.maven.skins.reflow.snippet.Processor
-
- Direct Known Subclasses:
Processor.WebComponentProcessor
public abstract class Processor extends Object
Specific process for each type of snippet component.- Version:
- 2.4
- Author:
- Christophe Friederich
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProcessor.WebComponentProcessorSpecific process for snippet web component.
-
Field Summary
Fields Modifier and Type Field Description protected SnippetParserparser
-
Constructor Summary
Constructors Constructor Description Processor(SnippetParser parser)Default constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidappendChildrenToHtml(org.jsoup.nodes.Node node, Appendable writer)Append childNodein html rendering.protected org.jsoup.nodes.ElementconvertToHtml(ComponentToken startToken, ComponentToken endToken)Convert the snippet to html.protected voidhandleCloseTag(ComponentToken startToken, ComponentToken endToken)Handle close tag mismatch.protected voidhandleEmptyTag(ComponentToken token)Handle empty tag.protected voidhandleHtmlTag(ComponentToken token)Handle html tag.protected voidhandleStartTag(ComponentToken token)Handle start tag mismatch.voidparse(ComponentToken token)Specific parsing for eachComponentToken.
-
-
-
Field Detail
-
parser
protected final SnippetParser parser
-
-
Constructor Detail
-
Processor
public Processor(SnippetParser parser)
Default constructor- Parameters:
parser- current parser.
-
-
Method Detail
-
parse
public void parse(ComponentToken token)
Specific parsing for eachComponentToken.- Parameters:
token- the current token.
-
appendChildrenToHtml
protected abstract void appendChildrenToHtml(org.jsoup.nodes.Node node, Appendable writer) throws IOExceptionAppend childNodein html rendering.- Parameters:
node- the node to use.writer- the html writer- Throws:
IOException- If an I/O error occurs.
-
handleStartTag
protected void handleStartTag(ComponentToken token)
Handle start tag mismatch.- Parameters:
token- the token
-
handleCloseTag
protected void handleCloseTag(ComponentToken startToken, ComponentToken endToken)
Handle close tag mismatch.- Parameters:
startToken- the start tokenendToken- the end token.
-
handleEmptyTag
protected void handleEmptyTag(ComponentToken token)
Handle empty tag.- Parameters:
token- the token
-
handleHtmlTag
protected void handleHtmlTag(ComponentToken token)
Handle html tag.- Parameters:
token- the token
-
convertToHtml
protected org.jsoup.nodes.Element convertToHtml(@Nonnull ComponentToken startToken, @Nullable ComponentToken endToken)
Convert the snippet to html.- Parameters:
startToken- the start tokenendToken- the end token.- Returns:
- Returns a new
Elementrepresenting html represention of snippet.
-
-