|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nrl.parser.operators.XmlOperatorLoader
public class XmlOperatorLoader
Loading support for the operator classes.
Call 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.
Field Summary | |
---|---|
protected static String |
CURRENT_FILE_VERSION
File version of this persistence mechanism: currently 1.5.0 |
Constructor Summary | |
---|---|
XmlOperatorLoader(IModelLoader modelLoader,
IURIResolver uriResolver)
Initialise the persistence class. |
|
XmlOperatorLoader(IResolverFactory factory)
Initialise the persistence class using a factory. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String CURRENT_FILE_VERSION
Constructor Detail |
---|
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.Method Detail |
---|
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 from
javax.xml.bind.JAXBException
SAXException
IOException
ResolverException
public 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 file
javax.xml.bind.JAXBException
SAXException
IOException
ResolverException
public void save(IOperators operators, Writer writer) throws Exception
operators
- the operators to savewriter
- the writer
IOException
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |