Interface HtmlToJavaHtmlFlowNodeVisitor<T extends Appendable>

  • Type Parameters:
    T - the type of appendable used to store the Java source code
    All Superinterfaces:
    org.jsoup.select.NodeVisitor
    All Known Implementing Classes:
    AbstractHtmlToJavaHtmlFlowNodeVisitor, DefaultHtmlToJavaHtmlFlowNodeVisitor

    public interface HtmlToJavaHtmlFlowNodeVisitor<T extends Appendable>
    extends org.jsoup.select.NodeVisitor
    Visitor of a JSoup node that converts the HTML source code into a Java class
    Author:
    Julien Gouesse
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void appendAttribute​(org.jsoup.nodes.Attribute attribute, Class<?> nodeClass)
      Appends the attribute value and key
      void appendFooter()
      Appends the footer of the Java class, i.e closes the method and the class
      void appendHeader()
      Appends the header of the Java class, i.e the imports, the declaration of the class, the declaration of the method, ...
      String convertJavaStringContentToJavaDeclarableString​(String javaStringContent)
      Converts the content of a Java string into a string that can be declared in a Java class passed as a method parameter
      T getAppendable()
      Returns the appendable used to store the Java class
      Class<?> getClassFromNodeName​(String nodeName)
      Returns the class of the node whose name is passed if any, otherwise null
      Method getMethodFromAttribute​(Class<?> nodeClass, org.jsoup.nodes.Attribute attribute)
      Returns the method of the class node that matches with the attribute if any, otherwise null
      boolean isUncloseable​(org.jsoup.nodes.Node node)
      Tells whether a JSoup node cannot be closed
      • Methods inherited from interface org.jsoup.select.NodeVisitor

        head, tail
    • Method Detail

      • appendHeader

        void appendHeader()
                   throws IOException
        Appends the header of the Java class, i.e the imports, the declaration of the class, the declaration of the method, ...
        Throws:
        IOException - thrown when something wrong occurs while appending the Java source code
      • appendFooter

        void appendFooter()
                   throws IOException
        Appends the footer of the Java class, i.e closes the method and the class
        Throws:
        IOException - thrown when something wrong occurs while appending the Java source code
      • appendAttribute

        void appendAttribute​(org.jsoup.nodes.Attribute attribute,
                             Class<?> nodeClass)
                      throws IOException
        Appends the attribute value and key
        Parameters:
        attribute - the attribute
        nodeClass - the class of the node
        Throws:
        IOException - thrown when something wrong occurs while appending the Java source code
      • isUncloseable

        boolean isUncloseable​(org.jsoup.nodes.Node node)
        Tells whether a JSoup node cannot be closed
        Parameters:
        node - the JSoup node
        Returns:
        true if the JSoup node cannot be closed, otherwise false
      • convertJavaStringContentToJavaDeclarableString

        String convertJavaStringContentToJavaDeclarableString​(String javaStringContent)
        Converts the content of a Java string into a string that can be declared in a Java class passed as a method parameter
        Parameters:
        javaStringContent - the content of a Java string
        Returns:
        a string that can be declared in a Java class passed as a method parameter
      • getAppendable

        T getAppendable()
        Returns the appendable used to store the Java class
        Returns:
        the appendable used to store the Java class
      • getClassFromNodeName

        Class<?> getClassFromNodeName​(String nodeName)
        Returns the class of the node whose name is passed if any, otherwise null
        Parameters:
        nodeName - the node name
        Returns:
        the class of the node whose name is passed if any, otherwise null
      • getMethodFromAttribute

        Method getMethodFromAttribute​(Class<?> nodeClass,
                                      org.jsoup.nodes.Attribute attribute)
        Returns the method of the class node that matches with the attribute if any, otherwise null
        Parameters:
        nodeClass - the class of the node
        attribute - the attribute
        Returns:
        the method of the class node that matches with the attribute if any, otherwise null