Package jade.content.onto
Class ReflectiveIntrospector
- java.lang.Object
-
- jade.content.onto.ReflectiveIntrospector
-
- All Implemented Interfaces:
Introspector,Serializable,Serializable
- Direct Known Subclasses:
BCReflectiveIntrospector,CFReflectiveIntrospector
public class ReflectiveIntrospector extends Object implements Introspector
The default introspector for user defined ontologies that uses Java Reflection to translate java objects to/from abstract descriptors.
NOT available in MIDP- Author:
- Federico Bergenti - Universita` di Parma, Giovanni Caire - TILAB
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReflectiveIntrospector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckClass(ObjectSchema schema, 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.AbsAggregateexternalizeAggregate(String slotName, Object obj, ObjectSchema schema, Ontology referenceOnto)AbsObjectexternalizeSpecialType(Object obj, ObjectSchema schema, Class javaClass, Ontology referenceOnto)protected MethodfindMethodCaseInsensitive(String name, Class c)ObjectgetSlotValue(String slotName, Object obj, ObjectSchema schema)ObjectinternalizeAggregate(String slotName, AbsAggregate abs, ObjectSchema schema, Ontology referenceOnto)ObjectinternalizeSpecialType(AbsObject abs, ObjectSchema schema, Class javaClass, Ontology referenceOnto)protected ObjectinvokeAccessorMethod(Method method, Object obj)protected voidinvokeSetterMethod(Method method, Object obj, Object value)protected booleanisAggregateObject(Object obj)voidsetSlotValue(String slotName, Object slotValue, Object obj, ObjectSchema schema)protected StringtranslateName(String name)
-
-
-
Method Detail
-
getSlotValue
public Object getSlotValue(String slotName, Object obj, ObjectSchema schema) throws OntologyException
- Specified by:
getSlotValuein interfaceIntrospector- Throws:
OntologyException
-
isAggregateObject
protected boolean isAggregateObject(Object obj)
-
invokeAccessorMethod
protected Object invokeAccessorMethod(Method method, Object obj) throws OntologyException
- Throws:
OntologyException
-
setSlotValue
public void setSlotValue(String slotName, Object slotValue, Object obj, ObjectSchema schema) throws OntologyException
- Specified by:
setSlotValuein interfaceIntrospector- Throws:
OntologyException
-
invokeSetterMethod
protected void invokeSetterMethod(Method method, Object obj, Object value) throws OntologyException
- Throws:
OntologyException
-
checkClass
public void checkClass(ObjectSchema schema, 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:
checkClassin interfaceIntrospector- Parameters:
schema- The schema of the ontological elementjavaClass- The java class associated to the ontologcal elementonto- The Ontology that uses this Introspector- Throws:
OntologyException- if the java class does not have the correct structure
-
findMethodCaseInsensitive
protected Method findMethodCaseInsensitive(String name, Class c) throws OntologyException
- Throws:
OntologyException
-
externalizeAggregate
public AbsAggregate externalizeAggregate(String slotName, Object obj, ObjectSchema schema, Ontology referenceOnto) throws OntologyException
- Specified by:
externalizeAggregatein interfaceIntrospector- Throws:
OntologyException
-
internalizeAggregate
public Object internalizeAggregate(String slotName, AbsAggregate abs, ObjectSchema schema, Ontology referenceOnto) throws OntologyException
- Specified by:
internalizeAggregatein interfaceIntrospector- Throws:
OntologyException
-
externalizeSpecialType
public AbsObject externalizeSpecialType(Object obj, ObjectSchema schema, Class javaClass, Ontology referenceOnto) throws OntologyException
- Specified by:
externalizeSpecialTypein interfaceIntrospector- Throws:
OntologyException
-
internalizeSpecialType
public Object internalizeSpecialType(AbsObject abs, ObjectSchema schema, Class javaClass, Ontology referenceOnto) throws OntologyException
- Specified by:
internalizeSpecialTypein interfaceIntrospector- Throws:
OntologyException
-
-