Class ComponentResolver
- java.lang.Object
-
- org.devacfr.maven.skins.reflow.snippet.ComponentResolver
-
public class ComponentResolver extends Object
Resolve the type and tag type of component.- Version:
- 2.4
- Author:
- Christophe Friederich
-
-
Constructor Summary
Constructors Constructor Description ComponentResolver()Default constructorComponentResolver(SnippetParser parser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jsoup.select.Elementscollect(org.jsoup.nodes.Element document)Collects all (start,end,empty) Element corresponding to a snippet component.org.jsoup.select.Elementscollect(org.jsoup.nodes.Element root, Pattern searchPattern)static StringconvertElementToHtml(String html)Converts the snippet html to html format.static StringconvertElementToHtml(org.jsoup.nodes.Element element)Converts the snippet element to html format.ComponentTokencreate(org.jsoup.nodes.Element element)Create aComponentTokencorresponding to the element.protected static Map<String,String>extractAttributes(String text)booleanisSnippet(org.jsoup.nodes.Node node)org.jsoup.nodes.Elementnormalize(org.jsoup.nodes.Document document)Normalise theDocumentto enclose inline snippet in html element.
-
-
-
Constructor Detail
-
ComponentResolver
public ComponentResolver()
Default constructor
-
ComponentResolver
public ComponentResolver(SnippetParser parser)
-
-
Method Detail
-
isSnippet
public boolean isSnippet(org.jsoup.nodes.Node node)
-
collect
public org.jsoup.select.Elements collect(org.jsoup.nodes.Element document)
Collects all (start,end,empty) Element corresponding to a snippet component.- Parameters:
document- the Jsoup element to use- Returns:
- Return a
Elementsrepresenting all web components contained in Jsoup document.
-
normalize
public org.jsoup.nodes.Element normalize(org.jsoup.nodes.Document document)
Normalise theDocumentto enclose inline snippet in html element.- Parameters:
document- the document to use- Returns:
- Returns the same normalised
Document.
-
create
public ComponentToken create(org.jsoup.nodes.Element element)
Create aComponentTokencorresponding to the element.- Parameters:
element- the element to use.- Returns:
- Return a new instance of
ComponentTokenrepresenting the element.
-
collect
public org.jsoup.select.Elements collect(org.jsoup.nodes.Element root, Pattern searchPattern)
-
convertElementToHtml
public static String convertElementToHtml(org.jsoup.nodes.Element element)
Converts the snippet element to html format.- Parameters:
element- the html element to use.- Returns:
- Returns a
Stringrepresenting the snippet element in html format.
-
-