public final class XMLStorage extends StorageService
Options
- "processXSL" (boolean, '1' or '0')
- '1' if XSL processing instructions encountered in the file should be applied, '0' if not.
- "XSL" (string)
- The filename of an XSL script to apply to the input stream.
- "incrementalLoad" (boolean, '1' or '0')
- '1' if incremental loading (or lazy loading) should be used to load this file, '0' if the entire file should be loaded into memory at once.
- "Model" (string)
- Name of model to load, if stream contains multiple models.
- "setPI" (string)
- A processing instruction to set. The format is setPI="name value". The name of the processing instruction is the set of characters before the first whitespace. The value is everything after the first whitespace.
- "Option" (string)
- An XFA option to set. The value should be of the form name="value" or name='value'.
- "format" (string, "raw" or "simple" or "pretty")
- Set to "raw" to save with no whitespace or carriage returns; "simple" to add carriage returns but no whitespace; "pretty" to add carriage returns and whitespace to show the hierarchy of the XML file.
- "encoding" (string)
- The character set to use when writing the XML file.
- "indentLevel" (integer)
- the number of spaces to indent each nested level, only applied to pretty output
- "attributeQuoteChar" (char, " or ' )
- if ' attributes are enclosed in single quotes, if " attributes are enclosed by double quotes (default)
- "entityChars" (string)
- A list of individual characters to be represent with entity references. The default list will vary according to whether we're writing attributes or text values. This list will be added to the default list. e.g. "\x0A\x09" for linefeed and cr.
- "minEntityCharRange" (int)
- Any character value greater than or equal to this int are encoded with their entity references.
- "maxEntityCharRange" (int)
- Any character value less than or equal to this int are encoded with their entity references.
| Constructor and Description |
|---|
XMLStorage() |
XMLStorage(File xmlFile)
Constructs an XMLStorage object, specifying a data file name that will
be used for loading or saving data.
|
XMLStorage(URL url)
Constructs an XMLStorage object, specifying a data file URL that will
be used for loading or saving data.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAPIVersion()
Returns the API version tag from the XML file.
|
String |
getGenerator()
Returns the "generator" tag from the XML file.
|
Node |
loadModel(AppModel model,
File file,
String loadOptions,
String saveXSLFile)
Loads the contents of an InputStream into an AppModel, creating an
Node hierarchy.
|
Node |
loadModel(AppModel model,
InputStream inputStream,
String loadOptions,
String saveXSLFile)
Loads the contents of an InputStream into an AppModel, creating an
Node hierarchy.
|
Node |
loadModel(AppModel model,
InputStream inputStream,
String source,
String loadOptions,
String saveXSLFile)
Loads the contents of an InputStream into an AppModel, creating an
Node hierarchy.
|
Node |
loadModel(AppModel model,
String loadOptions,
String saveXSLFile)
Loads the file/datasource specified in the constructor into a model and
creates an Node hierarchy for it.
|
boolean |
loadXDP(AppModel oAppModel,
Document oDoc,
PacketHandler handler,
Object handlerData,
boolean bProcessXFAOnly) |
boolean |
loadXDP(AppModel appModel,
InputStream file,
PacketHandler handler,
Object handlerData,
boolean bProcessXFAOnly)
Loads the contents of a XDP stream into an AppModel, creating an
Node hierarchy.
|
void |
processXSL(boolean process)
Specifies whether or not to automatically process inline XSL statements
when loading the XML file.
|
void |
saveAggregate(String sRoot,
OutputStream outStream,
NodeList oNodes,
String saveOptions)
Save a group of nodes under an aggregating tag.
|
void |
saveModel(Model model,
String saveOptions)
Saves a model into a file/datasource, starting at the root.
|
void |
saveModelAs(Model model,
OutputStream file,
String saveOptions)
Saves a model to an open stream file.
|
void |
setGenerator(String newGeneratorTag)
setGenerator is a static routine which specifies the generator tag to be
written out when a model is saved to an XML file.
|
void |
setOption(String optionName,
String optionValue,
boolean bCritical)
Sets an option.
|
void |
XFAModelLoader(Model model,
Node configKey,
InputStream oStreamFile) |
public XMLStorage()
public XMLStorage(File xmlFile)
xmlFile - the name of the file containing the source XML.public XMLStorage(URL url)
url - the URL containing the source XML.public void setGenerator(String newGeneratorTag)
newGeneratorTag - the new value for the generator tag.public String getAPIVersion()
public String getGenerator()
public Node loadModel(AppModel model, InputStream inputStream, String loadOptions, String saveXSLFile)
loadModel(AppModel, InputStream, String, String, String)
overload should be used instead.model - the AppModel to be populated.inputStream - an open file to be read in.loadOptions - see the comment in the class description.saveXSLFile - specifies the name of a file to save intermediate
XSL output. This is intended as an aid to debugging only.public Node loadModel(AppModel model, InputStream inputStream, String source, String loadOptions, String saveXSLFile)
model - the AppModel to be populated.inputStream - an open file to be read in.source - the absolute file or URL name that inputStream was loaded from.loadOptions - see the comment in the class description.saveXSLFile - specifies the name of a file to save intermediate
XSL output. This is intended as an aid to debugging only.public Node loadModel(AppModel model, File file, String loadOptions, String saveXSLFile)
model - the XFAModel to be populated.file - a file to be read in.loadOptions - see the comment in the class description.saveXSLFile - specifies the name of a file to save intermediate
XSL output. This is intended as an aid to debugging only.public Node loadModel(AppModel model, String loadOptions, String saveXSLFile)
model - the AppModel to be populated with the data from the
datasource.loadOptions - see the comment in the class description.saveXSLFile - specifies the name of a file to save intermediate
XSL output. This is intended as an aid to debugging only.public boolean loadXDP(AppModel appModel, InputStream file, PacketHandler handler, Object handlerData, boolean bProcessXFAOnly)
appModel - the AppModel to be populated.file - an open file to be read in. We assume the file is positioned
appropriately.handler - Handler to do any special processing of packets
before XFA DOM is created.handlerData - Handler data.public boolean loadXDP(AppModel oAppModel, Document oDoc, PacketHandler handler, Object handlerData, boolean bProcessXFAOnly)
public void processXSL(boolean process)
process - TRUE if XSL should be automatically processed, FALSE if not.
This flag is simply stored and passed to
Document.load when one of the load routines is
called.public void saveAggregate(String sRoot, OutputStream outStream, NodeList oNodes, String saveOptions)
sRoot - The name to use for the aggregating tag. If sRoot is empty,
then the standard xdp:xdp with appropriate namespace will be
used.outStream - The output stream to write to.oNodes - The list of XFA Nodes to writesaveOptions - (optional) see the comment in the class description.public void saveModel(Model model, String saveOptions)
model - the XFAModel to be saved into the datasource.saveOptions - see the comment in the class description.public void saveModelAs(Model model, OutputStream file, String saveOptions)
model - the XFAModel to be saved.file - the open streamfile to write to.saveOptions - see the comment in the class description.public void setOption(String optionName, String optionValue, boolean bCritical)
Servicepublic void XFAModelLoader(Model model, Node configKey, InputStream oStreamFile)
Copyright © 2010 - 2020 Adobe. All Rights Reserved