public class XmlOperatorLoader extends Object
load(File, List) or load(URI, URI, List). This will load the
file and resolve model references. Any errors will be added to the supplied list.
Returns the version of the operator file loaded.
If there were no errors, call getOperators() to get the loaded operators.| Modifier and Type | Field and Description |
|---|---|
protected static String |
CURRENT_FILE_VERSION
File version of this persistence mechanism: currently 1.5.0
|
| Constructor and Description |
|---|
XmlOperatorLoader(IModelLoader modelLoader,
IURIResolver uriResolver)
Initialise the persistence class.
|
XmlOperatorLoader(IResolverFactory factory)
Initialise the persistence class using a factory.
|
| Modifier and Type | Method and Description |
|---|---|
IOperators |
getOperators() |
IOperators |
load(File file,
List<NRLError> errors)
Load from a file - see
#load(Reader). |
IOperators |
load(URI baseURI,
URI operatorFileUri,
List<NRLError> errors)
Load an operator file from a URI (relative or absolute) resolved against an absolute base URI.
|
void |
save(IOperators operators,
Writer writer)
Save the mapping using a writer.
|
protected static final String CURRENT_FILE_VERSION
public XmlOperatorLoader(IResolverFactory factory)
factory - the factory that will provide a model loader and URI resolverpublic XmlOperatorLoader(IModelLoader modelLoader, IURIResolver uriResolver)
modelLoader - an IModelLoader that will be used to resolve models
referenced by the operators.public IOperators getOperators()
public IOperators load(File file, List<NRLError> errors) throws javax.xml.bind.JAXBException, SAXException, IOException, ResolverException
#load(Reader).file - the file to load fromjavax.xml.bind.JAXBExceptionSAXExceptionIOExceptionResolverExceptionpublic IOperators load(URI baseURI, URI operatorFileUri, List<NRLError> errors) throws javax.xml.bind.JAXBException, SAXException, IOException, ResolverException
If the call was successful, calling getOperators() next returns the loaded
operators. The IOperators returned will have fully resolved and type
checked models.
operatorFileUri - an absolute uri pointing to the operator filejavax.xml.bind.JAXBExceptionSAXExceptionIOExceptionResolverExceptionpublic void save(IOperators operators, Writer writer) throws Exception
operators - the operators to savewriter - the writerIOExceptionExceptionCopyright © 2006-2013. All Rights Reserved.