Class InfosetOutputter
- Direct Known Subclasses:
JDOMInfosetOutputter
,ScalaXMLInfosetOutputter
,W3CDOMInfosetOutputter
DataProcessor.parse(input:org\.apache\.daffodil* DataProcessor.parse)
.
The Daffodil core will call
the various methods of this class in an order appropriate to create an
infoset representation.
Classes that extend InfosetOutputter are not guaranteed to be thread-safe.
Note that these functions all throw the generic java.lang.Exception to indicate error. Part of the reason to do this instead of a custom exception (e.g. InfosetOutputterException) is to simplify implementations. If an implementation already throws an exception when there is an error, there is no need to catch it and wrap it in a Daffodil specific exception. This is especially true considering Daffodil will just unwrap the exception and convert it to a SDE. Additionally, because Scala does not have checked exceptions, it can be difficult to ensure all expected exceptions are caught by implementations. This does mean some exceptions that you might normally expect to bubble up and will not, and will instead be turned into an SDE.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
endArray
(InfosetArray array) Called by Daffodil internals to signify the end of an array of elements.abstract void
endComplex
(InfosetComplexElement complex) Called by Daffodil internals to signify the end of a complex element.abstract void
Called by Daffodil internals to signify the end of the infoset.abstract void
endSimple
(InfosetSimpleElement diSimple) Called by Daffodil internals to signify the end of a simple element.final Path
Get the list of blob paths that were output in the infoset.final String
final String
abstract void
reset()
Reset the internal state of this InfosetOutputter.final void
setBlobAttributes
(Path dir, String prefix, String suffix) Set the attributes for how to create blob files.final void
setBlobPaths
(List<Path> blobPaths) Set the list of blob pathsabstract void
startArray
(InfosetArray array) Called by Daffodil internals to signify the beginning of an array of elements.abstract void
startComplex
(InfosetComplexElement complex) Called by Daffodil internals to signify the beginning of a complex element.abstract void
Called by Daffodil internals to signify the beginning of the infoset.abstract void
startSimple
(InfosetSimpleElement diSimple) Called by Daffodil internals to signify the beginning of a simple element.
-
Constructor Details
-
InfosetOutputter
public InfosetOutputter()
-
-
Method Details
-
reset
public abstract void reset()Reset the internal state of this InfosetOutputter. This should be called in between calls to the parse method.call to reuse these. When first constructed, no reset call is necessary.
-
startDocument
Called by Daffodil internals to signify the beginning of the infoset.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
endDocument
Called by Daffodil internals to signify the end of the infoset.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
startSimple
Called by Daffodil internals to signify the beginning of a simple element.- Parameters:
diSimple
- the simple element that is started. Various fields of DISimple can be accessed to determine things like the value, nil, name, namespace, etc.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
endSimple
Called by Daffodil internals to signify the end of a simple element.- Parameters:
diSimple
- the simple element that is ended. Various fields of DISimple can be accessed to determine things like the value, nil, name, namespace, etc.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
startComplex
Called by Daffodil internals to signify the beginning of a complex element.- Parameters:
complex
- the complex element that is started. Various fields of DIComplex can be accessed to determine things like the nil, name, namespace, etc.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
endComplex
Called by Daffodil internals to signify the end of a complex element.- Parameters:
complex
- the complex element that is ended. Various fields of DIComplex can be accessed to determine things like the nil, name, namespace, etc.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
startArray
Called by Daffodil internals to signify the beginning of an array of elements.- Parameters:
array
- the array that is started. Various fields of DIArray can be accessed to determine things like the name, namespace, etc.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
endArray
Called by Daffodil internals to signify the end of an array of elements.- Parameters:
array
- the array that is ended. Various fields of DIArray can be accessed to determine things like the name, namespace, etc.- Throws:
Exception
- if there was an error and Daffodil should stop parsing
-
setBlobAttributes
Set the attributes for how to create blob files.- Parameters:
dir
- the Path the the directory to create files. If the directory does not exist, Daffodil will attempt to create it before writing a blob.prefix
- the prefix string to be used in generating a blob file namesuffix
- the suffix string to be used in generating a blob file name
-
getBlobPrefix
- Returns:
- blob prefix string
-
getBlobSuffix
- Returns:
- blob suffix string
-
getBlobDirectory
- Returns:
- blob directory path
-
getBlobPaths
Get the list of blob paths that were output in the infoset.This is the same as what would be found by iterating over the infoset.
- Returns:
- list of blob paths that were output in the infoset.
-
setBlobPaths
Set the list of blob paths- Parameters:
blobPaths
- list of blob paths to be set
-