jade.content.onto
Class ReflectiveIntrospector

java.lang.Object
  |
  +--jade.content.onto.ReflectiveIntrospector
Direct Known Subclasses:
BCReflectiveIntrospector

public class ReflectiveIntrospector
extends java.lang.Object
implements Introspector

Author:
Federico Bergenti - Universita` di Parma, Giovanni Caire - TILAB
See Also:
Serialized Form

Constructor Summary
ReflectiveIntrospector()
           
 
Method Summary
 void checkClass(ObjectSchema schema, java.lang.Class javaClass, Ontology onto)
          Check the structure of a java class associated to an ontological element to ensure that translations to/from abstract descriptors and java objects (instances of that class) can be accomplished by this introspector.
 AbsObject externalise(java.lang.Object obj, ObjectSchema schema, java.lang.Class javaClass, Ontology referenceOnto)
          Translate an object of a class representing an element in an ontology into a proper abstract descriptor
protected  java.lang.reflect.Method findMethodCaseInsensitive(java.lang.String name, java.lang.Class c)
           
 java.lang.Object internalise(AbsObject abs, ObjectSchema schema, java.lang.Class javaClass, Ontology referenceOnto)
          Translate an abstract descriptor into an object of a proper class representing an element in an ontology
protected  java.lang.Object invokeAccessorMethod(java.lang.reflect.Method method, java.lang.Object obj)
           
protected  void invokeSetterMethod(java.lang.reflect.Method method, java.lang.Object obj, java.lang.Object value)
           
protected  java.lang.String translateName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectiveIntrospector

public ReflectiveIntrospector()
Method Detail

externalise

public AbsObject externalise(java.lang.Object obj,
                             ObjectSchema schema,
                             java.lang.Class javaClass,
                             Ontology referenceOnto)
                      throws OntologyException
Translate an object of a class representing an element in an ontology into a proper abstract descriptor
Specified by:
externalise in interface Introspector
Parameters:
obj - The Object to be translated
schema - The schema for the ontological element this object is an instance of.
javaClass - The class of the Object to be translated
referenceOnto - The reference ontology in the context of this translation.
Returns:
The Abstract descriptor produced by the translation
Throws:
OntologyException - If some error occurs during the translation

invokeAccessorMethod

protected java.lang.Object invokeAccessorMethod(java.lang.reflect.Method method,
                                                java.lang.Object obj)
                                         throws OntologyException

internalise

public java.lang.Object internalise(AbsObject abs,
                                    ObjectSchema schema,
                                    java.lang.Class javaClass,
                                    Ontology referenceOnto)
                             throws UngroundedException,
                                    OntologyException
Translate an abstract descriptor into an object of a proper class representing an element in an ontology
Specified by:
internalise in interface Introspector
Parameters:
abs - The abstract descriptor to be translated
schema - The schema for the ontological element this abstract descriptor is an instance of.
javaClass - The class of the Object to be produced by the translation
referenceOnto - The reference ontology in the context of this translation.
Returns:
The Java object produced by the translation
Throws:
UngroundedException - If the abstract descriptor to be translated contains a variable
OntologyException - If some error occurs during the translation

invokeSetterMethod

protected void invokeSetterMethod(java.lang.reflect.Method method,
                                  java.lang.Object obj,
                                  java.lang.Object value)
                           throws OntologyException

checkClass

public void checkClass(ObjectSchema schema,
                       java.lang.Class javaClass,
                       Ontology onto)
                throws OntologyException
Check the structure of a java class associated to an ontological element to ensure that translations to/from abstract descriptors and java objects (instances of that class) can be accomplished by this introspector.
Specified by:
checkClass in interface Introspector
Parameters:
schema - The schema of the ontological element
javaClass - The java class associated to the ontologcal element
onto - The Ontology that uses this Introspector
Throws:
OntologyException - if the java class does not have the correct structure

findMethodCaseInsensitive

protected java.lang.reflect.Method findMethodCaseInsensitive(java.lang.String name,
                                                             java.lang.Class c)
                                                      throws OntologyException

translateName

protected java.lang.String translateName(java.lang.String name)