|
Docmosis API 4.5.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.docmosis.template.population.MemoryDataProvider
com.docmosis.template.population.XMLDataProvider
A data provider that can be converted to or from XML.
Constructor Summary | |
XMLDataProvider()
Create a new empty XML Data Provider. |
|
XMLDataProvider(Document doc,
XMLNodeFilter filter,
boolean includeRoot,
StringInterceptor[] interceptors)
Create a new XML Data Provider with data based on the given Document. |
Method Summary | |
protected static void |
addElementsToDocument(MemoryDataProvider dp,
Node node,
Document doc)
Adds all immediate fields to the given XML node. |
void |
cleanup()
Perform any cleanup duties such as freeing resources. |
void |
setInjectedAttributeString(String key)
Marks the given key as an "injected" or "pushed up" attribute meaning that it was artificially injected into this DP when processing the XML structure. |
Document |
toXML()
Convert this Data Provider into XML. |
static Document |
toXML(MemoryDataProvider dp)
Convert the given Data Provider into XML. |
Methods inherited from class com.docmosis.template.population.MemoryDataProvider |
addDataProvider, finalize, getBoolean, getBooleanKeys, getDataProvider, getDataProviderCount, getDataProviderKeys, getImage, getImageKeys, getRealKey, getString, getStringKeys, hasBooleanKey, hasDataProviderKey, hasImageKey, hasStringKey, setBoolean, setFalse, setImage, setImage, setString, setTrue, toDebugString, toDebugString, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public XMLDataProvider()
public XMLDataProvider(Document doc, XMLNodeFilter filter, boolean includeRoot, StringInterceptor[] interceptors)
doc
- the XML Document.filter
- an XML filter to only allow nodes of interest, or nullincludeRoot
- whether or not the root node of the doc should form
the root node of the data or whether data building starts with childreninterceptors
- interceptors that allow key/value pairs in the data
to be processed for custom purposes (such as interpreting as images).Method Detail |
public void cleanup()
Cleanable
cleanup
in interface Cleanable
cleanup
in class MemoryDataProvider
public Document toXML() throws ParserConfigurationException
ParserConfigurationException
- for serious unexpected errors.public static Document toXML(MemoryDataProvider dp) throws ParserConfigurationException
dp
- the Data Provider to convert to XML
ParserConfigurationException
- for serious unexpected errors.
ClassCastException
- if any sub data provider of dp is not a MemoryDataProvider
(or subclass).protected static void addElementsToDocument(MemoryDataProvider dp, Node node, Document doc)
node
- the node to add elements to.doc
- any document, only used to create elements.
ClassCastException
- if the given data provider contains any data provider that is not
a MemoryDataProvider (or subclass).public void setInjectedAttributeString(String key)
key
- the key to flag
|
Docmosis API 4.5.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |