public class DataProcessor extends WithDiagnostics
Constructor and Description |
---|
DataProcessor(edu.illinois.ncsa.daffodil.processors.DataProcessor dp) |
Modifier and Type | Method and Description |
---|---|
ParseResult |
parse(java.nio.channels.ReadableByteChannel input)
Parse input data without specifying a length
|
ParseResult |
parse(java.nio.channels.ReadableByteChannel input,
long lengthLimitInBits)
Parse input data with a specified length
|
void |
save(java.nio.channels.WritableByteChannel output)
Save the DataProcessor
|
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
|
canProceed, getDiagnostics, isError
public DataProcessor(edu.illinois.ncsa.daffodil.processors.DataProcessor dp)
public void setValidationMode(ValidationMode mode)
mode
- mode to control validationpublic 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 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 ParseResult parse(java.nio.channels.ReadableByteChannel input, long lengthLimitInBits)
input
- data to be parsedlengthLimitInBits
- the length of the input data in bits. This must
be the actual length in bits if you want the
location().isAtEnd() function to work. If value
is -1, the isAtEnd() function will always return true.public ParseResult parse(java.nio.channels.ReadableByteChannel input)
Use this when you don't know how big the data is. Note that the isAtEnd()
does not work properly and will always return -1. If you need isAtEnd() to
work, you must use parse(java.nio.channels.ReadableByteChannel, long)
and
specify the length of the data.
input
- data to be parsed