|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.nrl.parser.operators.XmlOperatorPersistence
public class XmlOperatorPersistence
Persistence support for the operator classes. To use this for loading:
load(File) or load(Reader). This will load the file, and if
there are no errors, return the file version.
getOperators() to get the loaded operators.
For saving, just call save(IOperators, Writer).
| Nested Class Summary | |
|---|---|
static class |
XmlOperatorPersistence.LoadedVersion
Returned by load(Reader), the version of the
operator file. |
| Constructor Summary | |
|---|---|
XmlOperatorPersistence(javax.xml.bind.JAXBContext version14Context,
javax.xml.bind.JAXBContext version15Context)
Initialise the persistence class. |
|
| Method Summary | |
|---|---|
IOperators |
getOperators()
|
XmlOperatorPersistence.LoadedVersion |
load(File file)
Load from a file - see load(Reader). |
XmlOperatorPersistence.LoadedVersion |
load(Reader reader)
Load an operator XML file using a reader. |
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 |
| Constructor Detail |
|---|
public XmlOperatorPersistence(javax.xml.bind.JAXBContext version14Context,
javax.xml.bind.JAXBContext version15Context)
version14Context - context for version 1.4 schema (package is
net.sourceforge.nrl.parser.jaxb14)version15Context - context for version 1.5 schema (package is
net.sourceforge.nrl.parser.jaxb15)| Method Detail |
|---|
public IOperators getOperators()
public XmlOperatorPersistence.LoadedVersion load(File file)
throws javax.xml.bind.JAXBException,
SAXException,
IOException
load(Reader).
file - the file to load from
javax.xml.bind.JAXBException
SAXException
IOException
public XmlOperatorPersistence.LoadedVersion load(Reader reader)
throws javax.xml.bind.JAXBException,
SAXException,
IOException
If the call was successful, calling getOperators() next returns the loaded
operators.
reader - the reader
javax.xml.bind.JAXBException
SAXException
IOException
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 | |||||||||