edu.cs.ai.kreator.models
Class KnowledgebaseWriter

java.lang.Object
  extended by edu.cs.ai.kreator.models.KnowledgebaseWriter
All Implemented Interfaces:
ModelComponent

public abstract class KnowledgebaseWriter
extends java.lang.Object
implements ModelComponent

This abstract class models a knowledge base writer, i.e. a structure that is capable of writing the model of a knowledge base to a string in some specific syntax.

Author:
Matthias Thimm

Constructor Summary
KnowledgebaseWriter()
           
 
Method Summary
static java.util.List<KnowledgebaseWriter> getAllWriters()
          This method returns a comprehensive list of all writers currently available in the system.
abstract  java.lang.String getSupportedFileExtension()
          Returns the file extension of the files this writer writes (without the dot).
static KnowledgebaseWriter getWriterById(java.lang.String id)
          Returns a writer with the given identification string.
static java.util.List<KnowledgebaseWriter> getWritersFor(java.lang.Class<?> kbClass)
          Returns a list of all writers capable of writing instances of the given knowledge base class.
static java.util.List<KnowledgebaseWriter> getWritersFor(Knowledgebase kb)
          Returns a list of all writers capable of writing the given knowledge base.
abstract  java.lang.String write(Knowledgebase kb)
          Writes the given knowledge base into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.cs.ai.kreator.models.ModelComponent
getDescription, getId, getSupportedKnowledgeBaseClass
 

Constructor Detail

KnowledgebaseWriter

public KnowledgebaseWriter()
Method Detail

getWritersFor

public static java.util.List<KnowledgebaseWriter> getWritersFor(Knowledgebase kb)
Returns a list of all writers capable of writing the given knowledge base.

Parameters:
kb - a knowledge base.
Returns:
a list of writers capable of writing the given knowledge base.

getWritersFor

public static java.util.List<KnowledgebaseWriter> getWritersFor(java.lang.Class<?> kbClass)
Returns a list of all writers capable of writing instances of the given knowledge base class.

Parameters:
kbClass - a knowledge base class.
Returns:
a list of writers capable of writing instances of the given knowledge base class.

getWriterById

public static KnowledgebaseWriter getWriterById(java.lang.String id)
                                         throws UnknownKnowledgebaseWriterIdException
Returns a writer with the given identification string.

Parameters:
a - writer id
Returns:
a writer with the given identification string
Throws:
UnknownKnowledgebaseWriterIdException

getAllWriters

public static java.util.List<KnowledgebaseWriter> getAllWriters()
This method returns a comprehensive list of all writers currently available in the system.

Returns:
a comprehensive list of all writers currently available in the system.

write

public abstract java.lang.String write(Knowledgebase kb)
Writes the given knowledge base into a string.

Parameters:
kb - a knowledge base.
Returns:
a string representing the knowledge base.

getSupportedFileExtension

public abstract java.lang.String getSupportedFileExtension()
Returns the file extension of the files this writer writes (without the dot).

Returns:
the file extension of the files this writer writes (without the dot).