Package htmlflow.flowifier
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
Modifier and TypeMethodDescriptionvoidappendAttribute(org.jsoup.nodes.Attribute attribute, Class<?> nodeClass) Appends the attribute value and keyvoidAppends the footer of the Java class, i.e closes the method and the classvoidAppends the header of the Java class, i.e the imports, the declaration of the class, the declaration of the method, ...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 parameterReturns the appendable used to store the Java classClass<?>getClassFromNodeName(String nodeName) Returns the class of the node whose name is passed if any, otherwisenullgetMethodFromAttribute(Class<?> nodeClass, org.jsoup.nodes.Attribute attribute) Returns the method of the class node that matches with the attribute if any, otherwisenullbooleanisUncloseable(org.jsoup.nodes.Node node) Tells whether a JSoup node cannot be closedMethods inherited from interface org.jsoup.select.NodeVisitor
head, tail
-
Method Details
-
appendHeader
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
-
appendAttribute
Appends the attribute value and key- Parameters:
attribute- the attributenodeClass- 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:
trueif the JSoup node cannot be closed, otherwisefalse
-
convertJavaStringContentToJavaDeclarableString
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
Returns the class of the node whose name is passed if any, otherwisenull- Parameters:
nodeName- the node name- Returns:
- the class of the node whose name is passed if any, otherwise
null
-
getMethodFromAttribute
Returns the method of the class node that matches with the attribute if any, otherwisenull- Parameters:
nodeClass- the class of the nodeattribute- the attribute- Returns:
- the method of the class node that matches with the attribute if
any, otherwise
null
-