public class BCReflectiveIntrospector extends ReflectiveIntrospector
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:
Iterator getAllXXX()
void addXXX(T t)
Constructor and Description |
---|
BCReflectiveIntrospector() |
Modifier and Type | Method and Description |
---|---|
void |
checkClass(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.
|
private Class |
checkGetAndSet(String name,
Class c) |
private Class |
checkGetAndSet2(String name,
Class c) |
AbsAggregate |
externalizeAggregate(String slotName,
Object obj,
ObjectSchema schema,
Ontology referenceOnto) |
private Object |
getAggregateSlotValue(String slotName,
Object obj) |
private int |
getArgumentLength(Method m) |
private Class |
getArgumentType(Method m,
int no) |
private Class |
getReturnType(Method m) |
private Object |
getScalarSlotValue(String slotName,
Object obj) |
Object |
getSlotValue(String slotName,
Object obj,
ObjectSchema schema) |
Object |
internalizeAggregate(String slotName,
AbsAggregate abs,
ObjectSchema schema,
Ontology referenceOnto) |
private void |
invokeAddMethod(Method method,
Object obj,
Object value) |
protected boolean |
isAggregateObject(Object obj) |
void |
setSlotValue(String slotName,
Object slotValue,
Object obj,
ObjectSchema schema) |
externalizeSpecialType, findMethodCaseInsensitive, internalizeSpecialType, invokeAccessorMethod, invokeSetterMethod, translateName
protected boolean isAggregateObject(Object obj)
isAggregateObject
in class ReflectiveIntrospector
public Object getSlotValue(String slotName, Object obj, ObjectSchema schema) throws OntologyException
getSlotValue
in interface Introspector
getSlotValue
in class ReflectiveIntrospector
OntologyException
private Object getScalarSlotValue(String slotName, Object obj) throws OntologyException
OntologyException
private Object getAggregateSlotValue(String slotName, Object obj) throws OntologyException
OntologyException
public void setSlotValue(String slotName, Object slotValue, Object obj, ObjectSchema schema) throws OntologyException
setSlotValue
in interface Introspector
setSlotValue
in class ReflectiveIntrospector
OntologyException
private void invokeAddMethod(Method method, Object obj, Object value) throws OntologyException
OntologyException
public void checkClass(ObjectSchema schema, Class javaClass, Ontology onto) throws OntologyException
checkClass
in interface Introspector
checkClass
in class ReflectiveIntrospector
schema
- The schema of the ontological elementjavaClass
- The java class associated to the ontologcal elementonto
- The Ontology that uses this IntrospectorOntologyException
- if the java class does not have the correct
structureprivate Class checkGetAndSet(String name, Class c) throws OntologyException
OntologyException
private Class checkGetAndSet2(String name, Class c) throws OntologyException
OntologyException
private int getArgumentLength(Method m)
public AbsAggregate externalizeAggregate(String slotName, Object obj, ObjectSchema schema, Ontology referenceOnto) throws OntologyException
externalizeAggregate
in interface Introspector
externalizeAggregate
in class ReflectiveIntrospector
OntologyException
public Object internalizeAggregate(String slotName, AbsAggregate abs, ObjectSchema schema, Ontology referenceOnto) throws OntologyException
internalizeAggregate
in interface Introspector
internalizeAggregate
in class ReflectiveIntrospector
OntologyException