org.argouml.persistence
Class XmiFilePersister

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended byorg.argouml.persistence.AbstractFilePersister
          extended byorg.argouml.persistence.XmiFilePersister
All Implemented Interfaces:
ProjectFilePersister

public class XmiFilePersister
extends AbstractFilePersister

To persist to and from XMI file storage.


Field Summary
private static Logger LOG
           
 
Fields inherited from class org.argouml.persistence.AbstractFilePersister
 
Constructor Summary
XmiFilePersister()
          The constructor.
 
Method Summary
 Project doLoad(File file)
          This method creates a project from the specified URL Unlike the constructor which forces an .argo extension This method will attempt to load a raw XMI file This method can fail in several different ways.
 void doSave(Project project, File file)
          Save a project to a file in XMI format.
protected  String getDesc()
          (Just the description, not the extension between "()".)
 String getExtension()
          The extension valid for this type of file.
 
Methods inherited from class org.argouml.persistence.AbstractFilePersister
accept, addProgressListener, copyFile, createTempFile, fireProgressEvent, getDescription, getEncoding, removeProgressListener, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Constructor Detail

XmiFilePersister

public XmiFilePersister()
The constructor.

Method Detail

getExtension

public String getExtension()
Description copied from class: AbstractFilePersister
The extension valid for this type of file. (Just the chars, not the dot: e.g. "zargo".)

Specified by:
getExtension in class AbstractFilePersister
Returns:
the extension valid for this type of file
See Also:
AbstractFilePersister.getExtension()

getDesc

protected String getDesc()
Description copied from class: AbstractFilePersister
(Just the description, not the extension between "()".)

Specified by:
getDesc in class AbstractFilePersister
Returns:
the description valid for this type of file
See Also:
AbstractFilePersister.getDesc()

doSave

public void doSave(Project project,
                   File file)
            throws SaveException
Save a project to a file in XMI format.

Specified by:
doSave in class AbstractFilePersister
Parameters:
project - the project to save.
file - The file to write.
Throws:
SaveException - if anything goes wrong.
See Also:
AbstractFilePersister.save( org.argouml.kernel.Project, java.io.File)

doLoad

public Project doLoad(File file)
               throws OpenException
This method creates a project from the specified URL Unlike the constructor which forces an .argo extension This method will attempt to load a raw XMI file This method can fail in several different ways. Either by throwing an exception or by having the ArgoParser.SINGLETON.getLastLoadStatus() set to not true.

Specified by:
doLoad in interface ProjectFilePersister
Specified by:
doLoad in class AbstractFilePersister
Parameters:
file - The file to load the project from.
Returns:
The newly loaded project.
Throws:
OpenException - if the file can not be opened
See Also:
ProjectFilePersister.doLoad(java.io.File)


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook