org.semanticweb.owlapi.io
Interface OWLOntologyDocumentTarget

All Known Implementing Classes:
StreamDocumentTarget, StringDocumentTarget, SystemOutDocumentTarget, WriterDocumentTarget, ZipDocumentTarget

public interface OWLOntologyDocumentTarget

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 18-Nov-2007

Specifies an interface that provides a pointer to an ontology document where an ontology can be stored.

Any client that writes an ontology to a "stream" will first try to obtain a writer (if isWriterAvailable() returns true), followed by an OutputStream (if isOutputStreamAvailable() returns true), followed by trying to open a stream from a document IRI (if isDocumentIRIAvailable returns true).

A client that writes an ontology to a database or some similar storage will simply try to use the IRI returned by getDocumentIRI().


Method Summary
 IRI getDocumentIRI()
          Gets an IRI that points to an ontology document.
 java.io.OutputStream getOutputStream()
          Gets an OutputStream that can be used to write an ontology to an ontology document.
 java.io.Writer getWriter()
          Gets a Writer that can be used to write an ontology to an ontology document.
 boolean isDocumentIRIAvailable()
          Determines if an IRI that points to an ontology document is available.
 boolean isOutputStreamAvailable()
          Determines if this document target can be pointed to by an OutputStream.
 boolean isWriterAvailable()
          Determines if this document target can be pointed to by a Writer.
 

Method Detail

isWriterAvailable

boolean isWriterAvailable()
Determines if this document target can be pointed to by a Writer.

Returns:
true if a Writer can be obtained from this document target.

getWriter

java.io.Writer getWriter()
                         throws java.io.IOException
Gets a Writer that can be used to write an ontology to an ontology document.

Returns:
The writer
Throws:
java.io.IOException - if there was a problem obtaining the writer
OWLRuntimeException - if a writer is not available (isWriterAvailable() returns false) and this method is called.

isOutputStreamAvailable

boolean isOutputStreamAvailable()
Determines if this document target can be pointed to by an OutputStream.

Returns:
true if an OutputStream can be obtained from this document target.

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Gets an OutputStream that can be used to write an ontology to an ontology document.

Returns:
The output stream
Throws:
java.io.IOException - if there was a problem obtaining the output stream
OWLRuntimeException - if an output stream is not available (isOutputStreamAvailable() returns false) and this method is called.

isDocumentIRIAvailable

boolean isDocumentIRIAvailable()
Determines if an IRI that points to an ontology document is available. The IRI encodes the exact details of how an ontology should be saved to a document.

Returns:
true if an IRI is available, otherwise false.

getDocumentIRI

IRI getDocumentIRI()
Gets an IRI that points to an ontology document.

Returns:
The IRI
Throws:
OWLRuntimeException - if an IRI is not available (isDocumentIRIAvailable() returns false) and this method is called.