sk.uniba.euromath.editor
Class XMLResourceManipulator

java.lang.Object
  extended by sk.uniba.euromath.editor.XMLResourceManipulator

public final class XMLResourceManipulator
extends Object

Responsible for loading and saving XML data.

Author:
TV, Martin Vysny

Constructor Summary
XMLResourceManipulator(IEditorInput editorInput)
          Constructor.
 
Method Summary
 IPath getFile()
          Returns location path to the XML file.
 XMLAccess getXmlAccess()
          Returns the document instance.
protected  boolean isInputValid()
          Checks if this editor input is valid.
 void load()
          Deserializes the document.
protected  void load(IPath data)
           
 void save(String fullPathAndName)
          Saves (serializes) the document.
 void save(String fullPathAndName, String encoding, XMLSerializerPropertiesWidget deq)
          Serializes the document object model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLResourceManipulator

public XMLResourceManipulator(IEditorInput editorInput)
Constructor.

Parameters:
editorInput - document is deserialized from this editor input.
Method Detail

getFile

public IPath getFile()
Returns location path to the XML file.

Returns:
path to the xml file. The file may not exist if it was created.

getXmlAccess

public XMLAccess getXmlAccess()
Returns the document instance.

Returns:
the document instance. Never null.

isInputValid

protected final boolean isInputValid()
Checks if this editor input is valid.

Returns:
true if given editor input is valid, false otherwise.

load

public void load()
          throws SAXException,
                 IOException,
                 DocumentException,
                 SchemaException
Deserializes the document. The function fails if document is already loaded.

Throws:
SAXException
IOException
DocumentException
SchemaException

load

protected void load(IPath data)
             throws SAXException,
                    IOException,
                    DocumentException,
                    SchemaException
Parameters:
data -
Throws:
SAXException
IOException
DocumentException
SchemaException

save

public void save(String fullPathAndName)
          throws IOException
Saves (serializes) the document.

Parameters:
fullPathAndName - if not null then document is saved into given file name. Otherwise, it is saved to a file name specified by the XMLAccess instance.
Throws:
IOException - when i/o error occurs.

save

public void save(String fullPathAndName,
                 String encoding,
                 XMLSerializerPropertiesWidget deq)
          throws IOException
Serializes the document object model. Uses the DOM Level 3 Load/Save functionality, for details please see the DOM Level3 LS documentation.

Parameters:
fullPathAndName - if not null then document is saved into given file name. Otherwise, it is saved to a file name specified by the XMLAccess instance.
encoding - the encoding of the document. If null then default is used.
deq - output format parameters. May be null - in such case it is ignored.
Throws:
IOException - if serialization fails.


Copyright © 2003-2006 null. All Rights Reserved.