be.ac.vub.cocompose.io
Class FileModelWriter

java.lang.Object
  extended bybe.ac.vub.cocompose.io.FileModelWriter
All Implemented Interfaces:
ModelWriter
Direct Known Subclasses:
XMIModelWriter

public abstract class FileModelWriter
extends Object
implements ModelWriter

Introduces methods for writing to URIs.

Since:
0.2.0
Version:
0.2.4, 21/01/2004
Author:
Dennis Wagelaar

Constructor Summary
FileModelWriter()
           
 
Method Summary
protected  OutputStream getOutputStream(String uri)
          Opens an output stream to the given URI.
 StreamWriter getStreamWriter()
          Gets the stream writer.
 void setStreamWriter(StreamWriter streamWriter)
          Sets the stream writer.
 void write(Model model)
          Writes the model to its URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileModelWriter

public FileModelWriter()
Method Detail

write

public void write(Model model)
           throws IOException,
                  ModelElementException
Writes the model to its URI.

Specified by:
write in interface ModelWriter
Parameters:
model - - the model to write.
Throws:
IOException - - if the model could not be written.
ModelElementException - - if a model element could not be written.

getOutputStream

protected OutputStream getOutputStream(String uri)
                                throws IOException
Opens an output stream to the given URI.

Parameters:
uri - - the URI to look at.
Returns:
the output stream.
Throws:
IOException - - if the output stream could not be opened.

getStreamWriter

public StreamWriter getStreamWriter()
Gets the stream writer.

Returns:
the stream writer.

setStreamWriter

public void setStreamWriter(StreamWriter streamWriter)
Sets the stream writer.

Parameters:
streamWriter - - the stream writer.