public class DataProcessor extends WithDiagnostics implements scala.Serializable
| Constructor and Description |
|---|
DataProcessor(org.apache.daffodil.processors.DataProcessor dp) |
| Modifier and Type | Method and Description |
|---|---|
ParseResult |
parse(InputSourceDataInputStream input,
InfosetOutputter output)
Parse input data from an InputSourceDataInputStream and output the infoset to an InfosetOutputter
|
ParseResult |
parse(java.nio.channels.ReadableByteChannel input)
Deprecated.
Use parse(InputSourceDataInputStream, InfosetOutputter) to parse the data and get the infoset representation from the InfosetOutputter instead of ParseResult#result(). Since 2.2.0.
|
ParseResult |
parse(java.nio.channels.ReadableByteChannel input,
InfosetOutputter output)
Deprecated.
Use parse(InputSourceDataInputStream, InfosetOutputter) to parse the data and get the infoset representation from the InfosetOutputter instead of ParseResult#result(). Since 2.2.0.
|
ParseResult |
parse(java.nio.channels.ReadableByteChannel input,
InfosetOutputter output,
long lengthLimitInBits)
Deprecated.
Use parse(InputSourceDataInputStream, InfosetOutputter) to parse the data and get the infoset representation from the InfosetOutputter instead of ParseResult#result(). Since 2.2.0.
|
ParseResult |
parse(java.nio.channels.ReadableByteChannel input,
long lengthLimitInBits)
Deprecated.
Use parse(InputSourceDataInputStream, InfosetOutputter) to parse the data and get the infoset representation from the InfosetOutputter instead of ParseResult#result(). Since 2.2.0.
|
void |
save(java.nio.channels.WritableByteChannel output)
Save the DataProcessor
|
void |
setDebugger(DebuggerRunner dr)
Set the debugger runer
|
void |
setDebugging(boolean flag)
Enable/disable debugging.
|
void |
setExternalVariables(java.io.File extVars)
Read external variables from a Daffodil configuration file
|
void |
setExternalVariables(scala.collection.immutable.Map<java.lang.String,java.lang.String> extVars)
Set the value of multiple DFDL variables
|
void |
setValidationMode(ValidationMode mode)
Set validation mode
|
UnparseResult |
unparse(InfosetInputter input,
java.nio.channels.WritableByteChannel output)
Unparse an InfosetInputter
|
UnparseResult |
unparse(java.nio.channels.WritableByteChannel output,
org.jdom2.Document infoset)
Deprecated.
Use unparse(InfosetInputter, WritableByteChannel). Since 2.0.0.
|
canProceed, getDiagnostics, isErrorpublic DataProcessor(org.apache.daffodil.processors.DataProcessor dp)
public ParseResult parse(java.nio.channels.ReadableByteChannel input, long lengthLimitInBits)
input - data to be parsedlengthLimitInBits - the length of the input data in bits, or -1 if no limitpublic ParseResult parse(java.nio.channels.ReadableByteChannel input)
input - data to be parsedpublic ParseResult parse(java.nio.channels.ReadableByteChannel input, InfosetOutputter output, long lengthLimitInBits)
input - data to be parsedoutput - the InfosetOutputter that will be used to output the infosetlengthLimitInBits - the length of the input data in bits, or -1 if no limitpublic ParseResult parse(java.nio.channels.ReadableByteChannel input, InfosetOutputter output)
Use this when you don't know how big the data is.
input - data to be parsedoutput - the InfosetOutputter that will be used to output the infosetpublic ParseResult parse(InputSourceDataInputStream input, InfosetOutputter output)
input - data to be parsedoutput - the InfosetOutputter that will be used to output the infosetpublic void save(java.nio.channels.WritableByteChannel output)
The resulting output can be reloaded by Compiler.reload(java.nio.channels.ReadableByteChannel).
output - the byte channel to write the DataProcessor topublic void setDebugger(DebuggerRunner dr)
dr - debugger runnerpublic void setDebugging(boolean flag)
Before enabling, setDebugger(DebuggerRunner) must be called with a non-null debugger.
flag - true to enable debugging, false to disabledpublic void setExternalVariables(java.io.File extVars)
extVars - file to read DFDL variables from.public void setExternalVariables(scala.collection.immutable.Map<java.lang.String,java.lang.String> extVars)
extVars - a map of key/value pairs, where the key is the variable
name, and the value is the value of the variable. The key
may be preceded by a string of the form "{namespace}" to
define a namespace for the variable. If preceded with "{}",
then no namespace is used. If not preceded by anything,
then Daffodil will figure out the namespace.public void setValidationMode(ValidationMode mode) throws InvalidUsageException
mode - mode to control validationInvalidUsageException - if mode is not a valid ValidateMode valuepublic UnparseResult unparse(InfosetInputter input, java.nio.channels.WritableByteChannel output)
input - the infoset inputter to use for unparsingoutput - the byte channel to write the data topublic UnparseResult unparse(java.nio.channels.WritableByteChannel output, org.jdom2.Document infoset)
output - the byte channel to write the data toinfoset - the infoset to unparse, as a jdom event cursor