Java2OWL
Class J2OClassManager

Object
  extended by J2OClassManager

public class J2OClassManager
extends Object

This class manages all correspondences between Java-classes and OWL-classes.

For OWL-classes generated from Java-classes there is a one-to-one correspondence. In contrast to Java classes, OWL-classes allow for multiple inheritance. This means that for subclasses there is no one-to-one correspondence any more.

Example: Java-classes Ship and LandVehicle are mapped to OWL-classes. If in the extension ontology a common subclass AmphibiousCraft is externally added, this class corresponds to the two Java-classes Ship and LandVehicle. This becomes relevant when OWL-individuals are imported and mapped to Java-objects. In the case of AmphibiousCraft-instances, one could then generate two Java-objects, a Ship and a LandVehicle.


Constructor Summary
J2OClassManager(J2OManager manager)
          creates a class manager for the given top-manager.
 
Method Summary
 void activateSynchronisation(Object... classes)
          activates Java <-> OWL synchronisation for all objects in the given classes.
 void clear()
          clears all internal class-relevant data.
 void clearCache()
          clears the internal cache.
 void deactivateSynchronisation(Object... classes)
          deactivates Java <-> OWL synchronisation for all objects in the given classes.
 Set<Class> getClasses()
          returns the set of classes managed by the class manager.
 ClassWrapper getCLW(Class jcl)
          returns for a given Java class the corresponding class wrapper, or null if there is none stored.
 ClassWrapper getCLW(Class jcl, boolean direct)
          returns the ClassWrapper for the given Java class, or null if none can be found..
 Collection<ClassWrapper> getCLWs()
          returns the ClassWrappers managed by the class manager.
 Set<ClassWrapper> getCLWs(Set<OWLClass> ocls)
          yields the ClassWrappers which correspond to the given OWL-classes.
 String getName()
          returns the name of the class manager.
 OWLClass getOWLClass(Class jcl, boolean direct)
          yields the OWL-class which corresponds to the Java class jcl, or null.
 boolean isMapped(Class jcl)
          returns true if the Java class is directly mapped to an OWLClass.
 String toString()
          returns a string-representation of the class manager.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

J2OClassManager

public J2OClassManager(J2OManager manager)
creates a class manager for the given top-manager.

Method Detail

getName

public String getName()
returns the name of the class manager.


getCLW

public ClassWrapper getCLW(Class jcl)
returns for a given Java class the corresponding class wrapper, or null if there is none stored.


getClasses

public Set<Class> getClasses()
returns the set of classes managed by the class manager.


getCLWs

public Collection<ClassWrapper> getCLWs()
returns the ClassWrappers managed by the class manager.


isMapped

public boolean isMapped(Class jcl)
returns true if the Java class is directly mapped to an OWLClass.


getCLW

public ClassWrapper getCLW(Class jcl,
                           boolean direct)
returns the ClassWrapper for the given Java class, or null if none can be found..

Parameters:
jcl - a Java class.
direct - if false then jcl's superclasses are also searched for ClassWrapper.
Returns:
the corresponding ClassWrapper, or null if none could be found.

getOWLClass

public OWLClass getOWLClass(Class jcl,
                            boolean direct)
yields the OWL-class which corresponds to the Java class jcl, or null.

Parameters:
jcl - the Java Class.
direct - if false then jcl's superclasses are also searched for ClassWrapper.
cache - if true the finding is internally stored.
Returns:
the corresponding OWL-Class.

getCLWs

public Set<ClassWrapper> getCLWs(Set<OWLClass> ocls)
yields the ClassWrappers which correspond to the given OWL-classes.

Since OWL has multiple inheritance, an OWL-class may have several superclasses which correspond to Java-classes. The lowest such superclasses are returned. remember = true should only be used if the Java <-> OWL relations do not change any more for ocl's superclasses.

Parameters:
ocls - a set of OWL classes.
Returns:
the corresponding set of ClassWrapper.

activateSynchronisation

public void activateSynchronisation(Object... classes)
activates Java <-> OWL synchronisation for all objects in the given classes.

Parameters:
classes - are either single Java class, an array or a collection of Java classes.

For all these classes and their subclasses the synchronisation is activated. This activation can be overwritten at object level.

Before the synchronisation is activated all objects in the classes are synchronised with OWL.

See Also:
IndividualWrapper.activateSynchronisation.

deactivateSynchronisation

public void deactivateSynchronisation(Object... classes)
deactivates Java <-> OWL synchronisation for all objects in the given classes.

Parameters:
classes - are either single Java class, an array or a collection of Java classes.

For all these classes and their subclasses the synchronisation is activated. This activation can be overwritten at object level.

See Also:
IndividualWrapper.activateSynchronisation.

clearCache

public void clearCache()
clears the internal cache.


clear

public void clear()
clears all internal class-relevant data.


toString

public String toString()
returns a string-representation of the class manager.

Overrides:
toString in class Object