Class ComponentResolver


  • public class ComponentResolver
    extends Object
    Resolve the type and tag type of component.
    Version:
    2.4
    Author:
    Christophe Friederich
    • 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 Elements representing all web components contained in Jsoup document.
      • normalize

        public org.jsoup.nodes.Element normalize​(org.jsoup.nodes.Document document)
        Normalise the Document to 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 a ComponentToken corresponding to the element.
        Parameters:
        element - the element to use.
        Returns:
        Return a new instance of ComponentToken representing 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 String representing the snippet element in html format.
      • convertElementToHtml

        public static String convertElementToHtml​(String html)
        Converts the snippet html to html format.
        Parameters:
        html - the html to use.
        Returns:
        Returns a String representing the snippet html in html format.