org.argouml.persistence
Class MemberFilePersister

java.lang.Object
  extended byorg.argouml.persistence.MemberFilePersister
Direct Known Subclasses:
DiagramMemberFilePersister, ModelMemberFilePersister, TodoListMemberFilePersister

public abstract class MemberFilePersister
extends Object

A base class file persister for project members.


Constructor Summary
MemberFilePersister()
           
 
Method Summary
protected  void addXmlFileToWriter(PrintWriter writer, File file, int indent)
          Send an existing file of XML to the PrintWriter.
abstract  String getMainTag()
          Gets the tag name which is the root tag for this member.
abstract  void load(Project project, InputStream inputStream)
          Load the member based on instance variables which should have been setup in the constructor.
abstract  void save(ProjectMember member, Writer writer, Integer indent)
          Save the projectmember as XML to the given writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberFilePersister

public MemberFilePersister()
Method Detail

load

public abstract void load(Project project,
                          InputStream inputStream)
                   throws OpenException
Load the member based on instance variables which should have been setup in the constructor.

Parameters:
project - the project to persist
inputStream - the inputStream to parse to load the member.
Throws:
OpenException - on any parsing errors.

getMainTag

public abstract String getMainTag()
Gets the tag name which is the root tag for this member.

Returns:
tag name.

save

public abstract void save(ProjectMember member,
                          Writer writer,
                          Integer indent)
                   throws SaveException
Save the projectmember as XML to the given writer.

Parameters:
member - The project member to save.
writer - The Writer to which appen the save.
indent - The offset to which to indent the XML
Throws:
SaveException - if the save fails

addXmlFileToWriter

protected void addXmlFileToWriter(PrintWriter writer,
                                  File file,
                                  int indent)
                           throws SaveException
Send an existing file of XML to the PrintWriter.

Parameters:
writer - the PrintWriter.
file - the File
indent - How far to indent in the writer.
Throws:
SaveException - on any errors.


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