public class org.docgene.plugins.ElementHook |
---|
Modifier and Type | Method and Description |
---|---|
public default void | createArticles()
Create articles
|
public void | handleElement(ParagraphElement element)
Handle an element
|
public default void | startArticle(XMLArticle article)
Start the processing of an existing article
|
Set<String> | supportedElements()
Return the set of elements declarations which will be handled by this ElementHook
|
supportedElements()
returns a set with only "title", the method will be fired only for syntax elementscontext
) which offer methods to modify the tree content. The methods include:public void createArticles() { XMLArticle article = context.createArticle("myArticle"); XMLParagraph par = context.addParagraph(article); par.addElement(new XMLTitle(1, "theTitle", false)); }
int indexReq = 0; public Set<String> supportedElements() { return context.getSupportedDeclarations("title"); } public void handleElement(ParagraphElement element) { XMLTitle title = (XMLTitle)element; context.insertElementsAfter(new XMLSentence("Requirement: " + indexReq)); indexReq++; }
docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.