fr.opensagres.xdocreport.document.preprocessor.dom
Class DOMPreprocessor
java.lang.Object
fr.opensagres.xdocreport.document.preprocessor.AbstractXDocPreprocessor<Document>
fr.opensagres.xdocreport.document.preprocessor.dom.DOMPreprocessor
- All Implemented Interfaces:
- IXDocPreprocessor
- Direct Known Subclasses:
- DocxDocumentPreprocessor, DOMFontsPreprocessor
public abstract class DOMPreprocessor
- extends AbstractXDocPreprocessor<Document>
Method Summary |
protected void |
closeSource(Document reader)
|
protected String |
getDynamicAttr(Element element,
String attrName,
String contextIfKey,
String contextValueKey,
IDocumentFormatter formatter)
Generate directive (ex with FM: [#if ___font??] |
protected Document |
getSource(XDocArchive documentArchive,
String entryName)
|
boolean |
preprocess(String entryName,
Document document,
Writer writer,
FieldsMetadata fieldsMetadata,
IDocumentFormatter formatter,
Map<String,Object> sharedContext)
|
protected void |
updateDynamicAttr(Element element,
String attrName,
String contextKey,
IDocumentFormatter formatter)
|
protected void |
updateDynamicAttr(Element element,
String attrName,
String contextIfKey,
String contextValueKey,
IDocumentFormatter formatter)
|
protected abstract void |
visit(Document document,
String entryName,
FieldsMetadata fieldsMetadata,
IDocumentFormatter formatter,
Map<String,Object> sharedContext)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DOMPreprocessor
public DOMPreprocessor()
getSource
protected Document getSource(XDocArchive documentArchive,
String entryName)
throws XDocReportException,
IOException
- Specified by:
getSource
in class AbstractXDocPreprocessor<Document>
- Throws:
XDocReportException
IOException
closeSource
protected void closeSource(Document reader)
- Specified by:
closeSource
in class AbstractXDocPreprocessor<Document>
preprocess
public boolean preprocess(String entryName,
Document document,
Writer writer,
FieldsMetadata fieldsMetadata,
IDocumentFormatter formatter,
Map<String,Object> sharedContext)
throws XDocReportException,
IOException
- Specified by:
preprocess
in class AbstractXDocPreprocessor<Document>
- Throws:
XDocReportException
IOException
visit
protected abstract void visit(Document document,
String entryName,
FieldsMetadata fieldsMetadata,
IDocumentFormatter formatter,
Map<String,Object> sharedContext)
throws XDocReportException
- Throws:
XDocReportException
updateDynamicAttr
protected void updateDynamicAttr(Element element,
String attrName,
String contextKey,
IDocumentFormatter formatter)
- Parameters:
element
- attrName
- contextKey
- formatter
-
updateDynamicAttr
protected void updateDynamicAttr(Element element,
String attrName,
String contextIfKey,
String contextValueKey,
IDocumentFormatter formatter)
- Parameters:
element
- attrName
- contextKey
- formatter
-
getDynamicAttr
protected String getDynamicAttr(Element element,
String attrName,
String contextIfKey,
String contextValueKey,
IDocumentFormatter formatter)
- Generate directive (ex with FM: [#if ___font??]${___font}[#else]Arial[/#if])
- Parameters:
element
- attrName
- formatter
-
- Returns:
Copyright © 2013. All rights reserved.