Package org.apache.daffodil.api
Interface Compiler
public interface Compiler
Compile DFDL schemas into
ProcessorFactory's or
reload saved parsers into DataProcessor's.
Use Daffodil#compiler() to get a compiler instance.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ProcessorFactorycompileFile(File schemaFile) Compile DFDL schema file into aProcessorFactorydefault ProcessorFactorycompileFile(File schemaFile, String rootName) Compile DFDL schema file into aProcessorFactorycompileFile(File schemaFile, String rootName, String rootNamespace) Compile DFDL schema file into aProcessorFactorydefault ProcessorFactorycompileResource(String name) Compile DFDL resource name into aProcessorFactorydefault ProcessorFactorycompileResource(String name, String rootName) Compile DFDL resource name into aProcessorFactorycompileResource(String name, String rootName, String rootNamespace) Compile DFDL resource name into aProcessorFactorydefault ProcessorFactorycompileSource(URI uri) Compile DFDL schema source into aProcessorFactorydefault ProcessorFactorycompileSource(URI uri, String rootName) Compile DFDL schema source into aProcessorFactorycompileSource(URI uri, String rootName, String rootNamespace) Compile DFDL schema source into aProcessorFactoryReload a saved parser from a filereload(ReadableByteChannel savedParser) Reload a saved parser from a java.nio.channels.ReadableByteChannelwithTunable(String tunable, String value) Return a newCompilerwith a specific Daffodil tunable parameterwithTunables(Map<String, String> tunables) Return a newCompilerwith multiple tunable parameters
-
Method Details
-
compileFile
Compile DFDL schema file into aProcessorFactoryTo allow jar-file packaging, (where schema files might be part of a jar), it is recommended to use
Compiler.compileSourceinstead.- Parameters:
schemaFile- DFDL schema file used to create aProcessorFactory.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.
-
compileFile
Compile DFDL schema file into aProcessorFactoryTo allow jar-file packaging, (where schema files might be part of a jar), it is recommended to use
Compiler.compileSourceinstead.- Parameters:
schemaFile- DFDL schema file used to create aProcessorFactory.rootName- name of root element, or null to choose automatically from first element of schema.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.
-
compileFile
Compile DFDL schema file into aProcessorFactoryTo allow jar-file packaging, (where schema files might be part of a jar), it is recommended to use
Compiler.compileSourceinstead.- Parameters:
schemaFile- DFDL schema file used to create aProcessorFactory.rootName- name of root element, or null to choose automatically from first element of schema.rootNamespace- String of namespace of the root element, or null to infer automatically when unambiguous. Pass "" (empty string) for No Namespace.*- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.
-
compileSource
Compile DFDL schema source into aProcessorFactory- Parameters:
uri- URI of DFDL schema file used to create aProcessorFactory.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.
-
compileSource
Compile DFDL schema source into aProcessorFactory- Parameters:
uri- URI of DFDL schema file used to create aProcessorFactory.rootName- name of root element, or null to choose automatically from first element of schema.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.
-
compileSource
Compile DFDL schema source into aProcessorFactory- Parameters:
uri- URI of DFDL schema file used to create aProcessorFactory.rootName- name of root element, or null to choose automatically from first element of schema.rootNamespace- String of namespace of the root element, or null to infer automatically when unambiguous. Pass "" (empty string) for No Namespace.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.
-
compileResource
Compile DFDL resource name into aProcessorFactory- Parameters:
name- Resource name of a DFDL schema used to create aProcessorFactory.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.- Throws:
IOException- if resource cannot be found
-
compileResource
Compile DFDL resource name into aProcessorFactory- Parameters:
name- Resource name of a DFDL schema used to create aProcessorFactory.rootName- name of root element, or null to choose automatically from first element of schema.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.- Throws:
IOException- if resource cannot be found
-
compileResource
ProcessorFactory compileResource(String name, String rootName, String rootNamespace) throws IOException Compile DFDL resource name into aProcessorFactory- Parameters:
name- Resource name of a DFDL schema used to create aProcessorFactory.rootName- name of root element, or null to choose automatically from first element of schema.rootNamespace- String of namespace of the root element, or null to infer automatically when unambiguous. Pass "" (empty string) for No Namespace.- Returns:
ProcessorFactoryused to createDataProcessor(s). Must checkProcessorFactory.isErrorbefore using it.- Throws:
IOException- if resource cannot be found
-
reload
Reload a saved parser from a fileTo allow jar-file packaging, (where the savedParser might be part of a jar), it is recommended to use the other version of
Compiler.reload(savedParser:java\.nio\.channels\.ReadableByteChannel)* Compiler.reloadwhere the argument is a java.nio.channels.ReadableByteChannel for a saved parser.- Parameters:
savedParser- file of a saved parser, created withDataProcessor.save- Returns:
DataProcessorused to parse data. Must checkDataProcessor.isErrorbefore using it.- Throws:
InvalidParserException- if the file is not a valid saved parser.
-
reload
Reload a saved parser from a java.nio.channels.ReadableByteChannel- Parameters:
savedParser- java.nio.channels.ReadableByteChannel of a saved parser, created withDataProcessor.save- Returns:
DataProcessorused to parse data. Must checkDataProcessor.isErrorbefore using it.- Throws:
InvalidParserException- if the file is not a valid saved parser.
-
withTunable
Return a newCompilerwith a specific Daffodil tunable parameter- Parameters:
tunable- name of the tunable parameter to set.value- value of the tunable parameter to set- Returns:
- new
Compilerwith a specific Daffodil tunable parameter - See Also:
-
- Tunable Parameters - list of tunables names of default values
-
withTunables
Return a newCompilerwith multiple tunable parameters- Parameters:
tunables- a map of key/value pairs, where the key is the tunable name and the value is the value to set it to- Returns:
- new
Compilerwith multiple tunable parameters - See Also:
-
- Tunable Parameters - list of tunables names of default values
-