jade.content.onto
Class BCReflectiveIntrospector

java.lang.Object
  extended by jade.content.onto.ReflectiveIntrospector
      extended by jade.content.onto.BCReflectiveIntrospector
All Implemented Interfaces:
Introspector, java.io.Serializable

public class BCReflectiveIntrospector
extends ReflectiveIntrospector

Backward Compatible reflective introspector. This Introspector uses Java Reflection to translate java objects to/from abstract descriptors as the ReflectiveIntrospector does, but it assumes the accessors methods for aggregate slots to be in the "old JADE style" i.e. For every aggregate slot named XXX, with elements of type T, the Java class must have two accessible methods, with the following signature:


NOT available in MIDP

Author:
Giovanni Caire - TILAB
See Also:
Serialized Form

Constructor Summary
BCReflectiveIntrospector()
           
 
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.
 AbsAggregate externalizeAggregate(java.lang.String slotName, java.lang.Object obj, ObjectSchema schema, Ontology referenceOnto)
           
 java.lang.Object getSlotValue(java.lang.String slotName, java.lang.Object obj, ObjectSchema schema)
           
 java.lang.Object internalizeAggregate(java.lang.String slotName, AbsAggregate abs, ObjectSchema schema, Ontology referenceOnto)
           
protected  boolean isAggregateObject(java.lang.Object obj)
           
 void setSlotValue(java.lang.String slotName, java.lang.Object slotValue, java.lang.Object obj, ObjectSchema schema)
           
 
Methods inherited from class jade.content.onto.ReflectiveIntrospector
externalizeSpecialType, internalizeSpecialType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BCReflectiveIntrospector

public BCReflectiveIntrospector()
Method Detail

isAggregateObject

protected boolean isAggregateObject(java.lang.Object obj)

getSlotValue

public java.lang.Object getSlotValue(java.lang.String slotName,
                                     java.lang.Object obj,
                                     ObjectSchema schema)
                              throws OntologyException
Specified by:
getSlotValue in interface Introspector
Overrides:
getSlotValue in class ReflectiveIntrospector
Throws:
OntologyException

setSlotValue

public void setSlotValue(java.lang.String slotName,
                         java.lang.Object slotValue,
                         java.lang.Object obj,
                         ObjectSchema schema)
                  throws OntologyException
Specified by:
setSlotValue in interface Introspector
Overrides:
setSlotValue in class ReflectiveIntrospector
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
Overrides:
checkClass in class ReflectiveIntrospector
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

externalizeAggregate

public AbsAggregate externalizeAggregate(java.lang.String slotName,
                                         java.lang.Object obj,
                                         ObjectSchema schema,
                                         Ontology referenceOnto)
                                  throws OntologyException
Specified by:
externalizeAggregate in interface Introspector
Overrides:
externalizeAggregate in class ReflectiveIntrospector
Throws:
OntologyException

internalizeAggregate

public java.lang.Object internalizeAggregate(java.lang.String slotName,
                                             AbsAggregate abs,
                                             ObjectSchema schema,
                                             Ontology referenceOnto)
                                      throws OntologyException
Specified by:
internalizeAggregate in interface Introspector
Overrides:
internalizeAggregate in class ReflectiveIntrospector
Throws:
OntologyException


These are the official JADE API. For these API backward compatibility is guaranteed accross JADE versions