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 SnippetComponent<?>createSnippetComponent(SnippetContext snippetContext, ComponentToken startToken, ComponentToken endToken)Create aSnippetComponent.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.
-
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.
-
createSnippetComponent
protected SnippetComponent<?> createSnippetComponent(SnippetContext snippetContext, ComponentToken startToken, ComponentToken endToken)
Create aSnippetComponent.- Parameters:
snippetContext- the snippet context to use.startToken- the start token.endToken- the end token.- Returns:
- Returns a new instance of
SnippetComponentrepresenting the information contained betweenstartTokenandendToken.
-
-