Main class of the flowifier used to convert a whole document or the content of a node into a Java class @author Julien Gouesse
| 36 | * |
| 37 | */ |
| 38 | public class Flowifier { |
| 39 | |
| 40 | /** |
| 41 | * Constructor |
| 42 | */ |
| 43 | public Flowifier() { |
| 44 | super(); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Returns the Java source code of a class that generates the HTML source |
| 49 | * code of the given node |
| 50 | * |
| 51 | * @param <T> |
| 52 | * the type of appendable used to store the Java source code |
| 53 | * @param node |
| 54 | * the node whose content has to be converted |
| 55 | * @param htmlToJavaHtmlFlowNodeVisitor |
| 56 | * the visitor that performs the conversion |
| 57 | * @return the Java source code of a class that generates the HTML source |
| 58 | * code of the given node |
| 59 | */ |
| 60 | public <T extends Appendable> T toFlow( |
| 61 | final Node node, |
| 62 | final HtmlToJavaHtmlFlowNodeVisitor<T> htmlToJavaHtmlFlowNodeVisitor |
| 63 | ) { |
| 64 | node.traverse(htmlToJavaHtmlFlowNodeVisitor); |
| 65 | return htmlToJavaHtmlFlowNodeVisitor.getAppendable(); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Returns the Java source code of a class that generates the HTML source |
| 70 | * code of the given document |
| 71 | * |
| 72 | * @param <T> |
| 73 | * the type of appendable used to store the Java source code |
| 74 | * @param doc |
| 75 | * the document whose content has to be converted |
| 76 | * @param htmlToJavaHtmlFlowNodeVisitor |
| 77 | * the visitor that performs the conversion |
| 78 | * @return the Java source code of a class that generates the HTML source |
| 79 | * code of the given document |
| 80 | */ |
| 81 | public <T extends Appendable> T toFlow( |
| 82 | final Document doc, |
| 83 | final HtmlToJavaHtmlFlowNodeVisitor<T> htmlToJavaHtmlFlowNodeVisitor |
| 84 | ) { |
| 85 | return toFlow(doc.root(), htmlToJavaHtmlFlowNodeVisitor); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Returns the Java source code of a class that generates the HTML source |
| 90 | * code of the given document |
| 91 | * |
| 92 | * @param doc |
| 93 | * the document whose content has to be converted |
| 94 | * @return the Java source code of a class that generates the HTML source |
| 95 | * code of the given document |
nothing calls this directly
no outgoing calls
no test coverage detected