ch.uzh.ifi.attempto.acewiki.core
Class OntologyExporter

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.core.OntologyExporter
Direct Known Subclasses:
ACELexiconExporter, ACETextExporter, AceWikiDataExporter, LexiconTableExporter, OWLXMLExporter, StatementTableExporter

public abstract class OntologyExporter
extends java.lang.Object

This abstract class is used to export AceWiki ontologies in different formats.

Author:
Tobias Kuhn

Constructor Summary
protected OntologyExporter()
          Creates a new exporter.
 
Method Summary
 void export(java.io.OutputStream outputStream)
          Writes the export content into the given output stream.
abstract  java.lang.String getContentType()
          Returns the content type for the given export type.
abstract  java.lang.String getFileSuffix()
          Returns the file suffix for the given export type.
abstract  java.lang.String getName()
          Returns the name of this exporter as shown to the user.
protected  Ontology getOntology()
          Returns the AceWiki ontology for this exporter.
protected  java.util.List<OntologyElement> getOntologyElements()
          Returns the list of all ontology elements.
protected  java.io.OutputStream getOutputStream()
          Returns the current output stream.
abstract  boolean isApplicable()
          Returns whether this ontology exporter is applicable in the current context.
protected  void write(java.lang.String str)
          Writes the given string into the current output stream.
protected abstract  void writeContent()
          This internal method should write the export content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyExporter

protected OntologyExporter()
Creates a new exporter.

Method Detail

export

public void export(java.io.OutputStream outputStream)
Writes the export content into the given output stream. The stream is closed at the end.

Parameters:
outputStream - The output stream.

isApplicable

public abstract boolean isApplicable()
Returns whether this ontology exporter is applicable in the current context.

Returns:
true if this ontology exporter is applicable.

getName

public abstract java.lang.String getName()
Returns the name of this exporter as shown to the user.

Returns:
The name of this exporter.

writeContent

protected abstract void writeContent()
                              throws java.io.IOException
This internal method should write the export content.

Throws:
java.io.IOException - when an IO problem occurs.

getFileSuffix

public abstract java.lang.String getFileSuffix()
Returns the file suffix for the given export type.

Returns:
The file suffix.

getContentType

public abstract java.lang.String getContentType()
Returns the content type for the given export type.

Returns:
The content type.

getOntology

protected Ontology getOntology()
Returns the AceWiki ontology for this exporter.

Returns:
The AceWiki ontology.

getOntologyElements

protected java.util.List<OntologyElement> getOntologyElements()
Returns the list of all ontology elements.

Returns:
The ontology elements.

getOutputStream

protected java.io.OutputStream getOutputStream()
Returns the current output stream.

Returns:
The current output stream.

write

protected void write(java.lang.String str)
              throws java.io.IOException
Writes the given string into the current output stream.

Parameters:
str - The string to be written.
Throws:
java.io.IOException - when an IO problem occurs.


Copyright 2008-2012, AceWiki developers