JADE_SL.onto
Class ReflectiveIntrospector

java.lang.Object
  extended byJADE_SL.onto.ReflectiveIntrospector
All Implemented Interfaces:
Introspector

public class ReflectiveIntrospector
extends java.lang.Object
implements Introspector

Author:
Federico Bergenti - Universita` di Parma

Constructor Summary
ReflectiveIntrospector()
           
 
Method Summary
 void checkClass(ObjectSchema schema, java.lang.Class javaClass)
          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(Ontology onto, Ontology referenceOnto, java.lang.Object obj)
          Translate an object of a class representing an element in an ontology into a proper abstract descriptor
 java.lang.Object internalise(Ontology onto, Ontology referenceOnto, AbsObject abs)
          Translate an abstract descriptor into an object of a proper class representing an element in an ontology
private  AbsObject invokeGetMethod(Ontology onto, java.lang.reflect.Method method, java.lang.Object obj)
           
private  void invokeSetMethod(Ontology onto, java.lang.reflect.Method method, java.lang.Object obj, AbsObject value)
           
 
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(Ontology onto,
                             Ontology referenceOnto,
                             java.lang.Object obj)
                      throws UnknownSchemaException,
                             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:
onto - The ontology that uses this Introspector.
referenceOnto - The reference ontology in the context of this translation i.e. the most extended ontology that extends onto (directly or indirectly).
obj - The Object to be translated
Returns:
The Abstract descriptor produced by the translation
Throws:
UnknownSchemaException - If no schema for the object to be translated is defined in the ontology that uses this Introspector
OntologyException - If some error occurs during the translation

invokeGetMethod

private AbsObject invokeGetMethod(Ontology onto,
                                  java.lang.reflect.Method method,
                                  java.lang.Object obj)
                           throws OntologyException
Throws:
OntologyException

internalise

public java.lang.Object internalise(Ontology onto,
                                    Ontology referenceOnto,
                                    AbsObject abs)
                             throws UngroundedException,
                                    UnknownSchemaException,
                                    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:
onto - The ontology that uses this Introspector.
referenceOnto - The reference ontology in the context of this translation i.e. the most extended ontology that extends onto (directly or indirectly).
abs - The abstract descriptor to be translated
Returns:
The Java object produced by the translation
Throws:
UngroundedException - If the abstract descriptor to be translated contains a variable
UnknownSchemaException - If no schema for the abstract descriptor to be translated is defined in the ontology that uses this Introspector
OntologyException - If some error occurs during the translation

invokeSetMethod

private void invokeSetMethod(Ontology onto,
                             java.lang.reflect.Method method,
                             java.lang.Object obj,
                             AbsObject value)
                      throws OntologyException
Throws:
OntologyException

checkClass

public void checkClass(ObjectSchema schema,
                       java.lang.Class javaClass)
                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
Throws:
OntologyException - if the java class does not have the correct structure


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.