edu.stanford.smi.protegex.owl.model.factory
Class OWLJavaFactory

java.lang.Object
  extended byedu.stanford.smi.protege.model.framestore.DefaultFrameFactory
      extended byedu.stanford.smi.protegex.owl.model.factory.OWLJavaFactory
All Implemented Interfaces:
edu.stanford.smi.protege.model.FrameFactory
Direct Known Subclasses:
SWRLJavaFactory

public class OWLJavaFactory
extends edu.stanford.smi.protege.model.framestore.DefaultFrameFactory

A DefaultFrameFactory that creates the proper Java objects for Protege frames.

Author:
Holger Knublauch

Field Summary
private static String CLASSNAME_PREFIX
           
private static Hashtable clsNames
          A Hashtable from Protege metaclass names to Java class names from this package
private  AbstractOWLModel owlModel
           
 
Fields inherited from class edu.stanford.smi.protege.model.framestore.DefaultFrameFactory
 
Constructor Summary
OWLJavaFactory(AbstractOWLModel owlModel)
           
 
Method Summary
 RDFResource as(RDFResource resource, Class javaInterface)
           
 boolean canAs(RDFResource resource, Class javaInterface)
           
 edu.stanford.smi.protege.model.Cls createCls(edu.stanford.smi.protege.model.FrameID id, Collection directTypes)
          Creates instances of the corresponding subclass of DefaultCls if one of the metaclasses of the directTypes list is an OWL metaclass.
private  edu.stanford.smi.protege.model.Cls createCls(String javaClassName, edu.stanford.smi.protege.model.FrameID id)
           
 edu.stanford.smi.protege.model.SimpleInstance createSimpleInstance(edu.stanford.smi.protege.model.FrameID id, Collection directTypes)
           
 edu.stanford.smi.protege.model.Slot createSlot(edu.stanford.smi.protege.model.FrameID id, Collection directTypes)
           
 Class getImplementationClass(Class javaInterface)
           
 String getImplementationClassName(Class javaInterface)
           
 Constructor getImplementationConstructor(Class javaInterface)
           
 String getJavaInterfaceName(RDFSClass cls)
           
 boolean isCorrectJavaImplementationClass(edu.stanford.smi.protege.model.FrameID id, Collection types, Class clas)
           
 
Methods inherited from class edu.stanford.smi.protege.model.framestore.DefaultFrameFactory
addJavaPackage, configureCls, configureFacet, configureSimpleInstance, configureSlot, createCls, createFacet, createFacet, createFrameFromClassId, createSimpleInstance, createSlot, getClsJavaClassIds, getFacetJavaClassIds, getImplementationClass, getJavaClassId, getJavaClassName, getKnowledgeBase, getSimpleInstanceJavaClassIds, getSlotJavaClassIds, isValidCharacter, removeJavaPackage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clsNames

private static Hashtable clsNames
A Hashtable from Protege metaclass names to Java class names from this package


CLASSNAME_PREFIX

private static final String CLASSNAME_PREFIX
See Also:
Constant Field Values

owlModel

private AbstractOWLModel owlModel
Constructor Detail

OWLJavaFactory

public OWLJavaFactory(AbstractOWLModel owlModel)
Method Detail

as

public RDFResource as(RDFResource resource,
                      Class javaInterface)

canAs

public boolean canAs(RDFResource resource,
                     Class javaInterface)

getImplementationClassName

public String getImplementationClassName(Class javaInterface)

getImplementationClass

public Class getImplementationClass(Class javaInterface)
                             throws ClassNotFoundException
Throws:
ClassNotFoundException

getImplementationConstructor

public Constructor getImplementationConstructor(Class javaInterface)

getJavaInterfaceName

public String getJavaInterfaceName(RDFSClass cls)

createCls

public edu.stanford.smi.protege.model.Cls createCls(edu.stanford.smi.protege.model.FrameID id,
                                                    Collection directTypes)
Creates instances of the corresponding subclass of DefaultCls if one of the metaclasses of the directTypes list is an OWL metaclass.

Parameters:
id -
directTypes -
Returns:
the new Cls object

createCls

private edu.stanford.smi.protege.model.Cls createCls(String javaClassName,
                                                     edu.stanford.smi.protege.model.FrameID id)

createSimpleInstance

public edu.stanford.smi.protege.model.SimpleInstance createSimpleInstance(edu.stanford.smi.protege.model.FrameID id,
                                                                          Collection directTypes)

createSlot

public edu.stanford.smi.protege.model.Slot createSlot(edu.stanford.smi.protege.model.FrameID id,
                                                      Collection directTypes)

isCorrectJavaImplementationClass

public boolean isCorrectJavaImplementationClass(edu.stanford.smi.protege.model.FrameID id,
                                                Collection types,
                                                Class clas)