org.semanticweb.owlapi.io
Class StringDocumentSource

java.lang.Object
  extended by org.semanticweb.owlapi.io.StringDocumentSource
All Implemented Interfaces:
OWLOntologyDocumentSource

public class StringDocumentSource
extends java.lang.Object
implements OWLOntologyDocumentSource

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 24-Apr-2007

An ontology input source that wraps a string.


Field Summary
static java.lang.String DOCUMENT_IRI_SCHEME
           
 
Constructor Summary
StringDocumentSource(java.lang.String string)
           
StringDocumentSource(java.lang.String string, IRI documentIRI)
          Specifies a string as an ontology document.
 
Method Summary
 IRI getDocumentIRI()
          Gets the IRI of the ontology document.
 java.io.InputStream getInputStream()
          If an input stream can be obtained from this document source then this method creates it.
static IRI getNextDocumentIRI()
           
 java.io.Reader getReader()
          Gets a reader which an ontology document can be read from.
 boolean isInputStreamAvailable()
          Determines if an input stream is available which an ontology document can be parsed from.
 boolean isReaderAvailable()
          Determines if a reader is available which an ontology document can be parsed from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_IRI_SCHEME

public static final java.lang.String DOCUMENT_IRI_SCHEME
See Also:
Constant Field Values
Constructor Detail

StringDocumentSource

public StringDocumentSource(java.lang.String string)

StringDocumentSource

public StringDocumentSource(java.lang.String string,
                            IRI documentIRI)
Specifies a string as an ontology document.

Parameters:
string - The string
documentIRI - The document IRI
Method Detail

getNextDocumentIRI

public static IRI getNextDocumentIRI()

isReaderAvailable

public boolean isReaderAvailable()
Description copied from interface: OWLOntologyDocumentSource
Determines if a reader is available which an ontology document can be parsed from.

Specified by:
isReaderAvailable in interface OWLOntologyDocumentSource
Returns:
true if a reader can be obtained from this document source, or false if a reader cannot be obtained from this document source.

getReader

public java.io.Reader getReader()
Description copied from interface: OWLOntologyDocumentSource
Gets a reader which an ontology document can be read from. This method may be called multiple times. Each invocation will return a new Reader. This method should not be called if the isReaderAvailable method returns false. A Runtime execption will be thrown if this happens.

Specified by:
getReader in interface OWLOntologyDocumentSource
Returns:
A new Reader which the ontology can be read from.

isInputStreamAvailable

public boolean isInputStreamAvailable()
Description copied from interface: OWLOntologyDocumentSource
Determines if an input stream is available which an ontology document can be parsed from.

Specified by:
isInputStreamAvailable in interface OWLOntologyDocumentSource
Returns:
true if an input stream can be obtained, false if an input stream cannot be obtained from this document source.

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: OWLOntologyDocumentSource
If an input stream can be obtained from this document source then this method creates it. This method may be called multiple times. Each invocation will return a new input stream. This method should not be called if the isInputStreamAvailable method returns false.

Specified by:
getInputStream in interface OWLOntologyDocumentSource
Returns:
A new input stream which the ontology can be read from.

getDocumentIRI

public IRI getDocumentIRI()
Description copied from interface: OWLOntologyDocumentSource
Gets the IRI of the ontology document.

Specified by:
getDocumentIRI in interface OWLOntologyDocumentSource
Returns:
An IRI which represents the ontology document IRI - this will never be null.