net.sourceforge.nrl.parser.operators
Class XmlOperatorPersistence

java.lang.Object
  extended by net.sourceforge.nrl.parser.operators.XmlOperatorPersistence

Deprecated. Use XmlOperatorLoader.

@Deprecated
public class XmlOperatorPersistence
extends Object

Persistence support for the operator classes. To use this for loading:

For saving, just call save(IOperators, Writer).

Since:
1.5.0
Author:
Christian Nentwich

Nested Class Summary
static class XmlOperatorPersistence.LoadedVersion
          Deprecated. Returned by load(Reader), the version of the operator file.
 
Constructor Summary
XmlOperatorPersistence()
          Deprecated.  
XmlOperatorPersistence(javax.xml.bind.JAXBContext version14Context, javax.xml.bind.JAXBContext version15Context)
          Deprecated. Use XmlOperatorPersistence() instead
 
Method Summary
 IOperators getOperators()
          Deprecated.  
 XmlOperatorPersistence.LoadedVersion load(File file)
          Deprecated. Load from a file - see load(Reader).
 XmlOperatorPersistence.LoadedVersion load(Reader reader)
          Deprecated. Load an operator XML file using a reader.
 void save(IOperators operators, Writer writer)
          Deprecated. 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

XmlOperatorPersistence

@Deprecated
public XmlOperatorPersistence(javax.xml.bind.JAXBContext version14Context,
                                         javax.xml.bind.JAXBContext version15Context)
Deprecated. Use XmlOperatorPersistence() instead

Initialise the persistence class. The caller must provide the JAXB context for the version 1.4 schema and version 1.5 schema. This is so that the caller can make its own decision about caching / creating the context.

Parameters:
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)

XmlOperatorPersistence

public XmlOperatorPersistence()
Deprecated. 
Method Detail

getOperators

public IOperators getOperators()
Deprecated. 

load

public XmlOperatorPersistence.LoadedVersion load(File file)
                                          throws javax.xml.bind.JAXBException,
                                                 SAXException,
                                                 IOException
Deprecated. 
Load from a file - see load(Reader).

Parameters:
file - the file to load from
Returns:
the loaded file version
Throws:
javax.xml.bind.JAXBException
SAXException
IOException

load

public XmlOperatorPersistence.LoadedVersion load(Reader reader)
                                          throws javax.xml.bind.JAXBException,
                                                 SAXException,
                                                 IOException
Deprecated. 
Load an operator XML file using a reader. If this was successful, returns the version of the file.

If the call was successful, calling getOperators() next returns the loaded operators.

Parameters:
reader - the reader
Returns:
the version
Throws:
javax.xml.bind.JAXBException
SAXException
IOException

save

public void save(IOperators operators,
                 Writer writer)
          throws Exception
Deprecated. 
Save the mapping using a writer. Always indents.

Parameters:
operators - the operators to save
writer - the writer
Throws:
IOException
Exception


Copyright © 2006-2013. All Rights Reserved.