public class BasicOntology extends Ontology implements SL0Vocabulary
Modifier and Type | Field and Description |
---|---|
static String |
BOOLEAN |
static String |
BYTE_SEQUENCE |
static String |
CONTENT_ELEMENT_LIST |
static String |
DATE |
static String |
FLOAT |
static String |
INTEGER |
private Map |
primitiveSchemas |
static String |
STRING |
private static BasicOntology |
theInstance |
ACLMSG, ACLMSG_BYTE_SEQUENCE_CONTENT, ACLMSG_CONTENT, ACLMSG_CONVERSATION_ID, ACLMSG_ENCODING, ACLMSG_IN_REPLY_TO, ACLMSG_LANGUAGE, ACLMSG_ONTOLOGY, ACLMSG_PERFORMATIVE, ACLMSG_PROTOCOL, ACLMSG_RECEIVERS, ACLMSG_REPLY_BY, ACLMSG_REPLY_TO, ACLMSG_REPLY_WITH, ACLMSG_SENDER, ACTION, ACTION_ACTION, ACTION_ACTOR, AID, AID_ADDRESSES, AID_NAME, AID_RESOLVERS, DONE, DONE_ACTION, DONE_CONDITION, EQUALS, EQUALS_LEFT, EQUALS_RIGHT, FALSE_PROPOSITION, RESULT, RESULT_ACTION, RESULT_ITEMS, RESULT_VALUE, SEQUENCE, SET, TRUE_PROPOSITION
Modifier | Constructor and Description |
---|---|
private |
BasicOntology()
Constructor
|
Modifier and Type | Method and Description |
---|---|
static Object |
adjustPrimitiveValue(Object srcValue,
Class destClass)
Convert, if possible, the numeric value srcValue into an instance of destClass
|
private ObjectSchema |
createMsgSchema(String performative)
Note that we don't want to keep 22 different schemas for the 22
FIPA communicative acts --> We generate the schemas for communicative
acts on the fly as needed.
|
private void |
fillPrimitiveSchemas() |
protected AbsObject |
fromObject(Object obj,
Ontology referenceOnto)
This method is redefined as BasicOntology does not use an
Introspector for performance reason
|
static Ontology |
getInstance()
Returns the singleton instance of the
BasicOntology . |
ObjectSchema |
getSchema(Class clazz)
Redefine the
getSchema() method to take into
account java primitives. |
ObjectSchema |
getSchema(String name)
Redefine the
getSchema() method to take into
account ACL performatives. |
private void |
initialize() |
private void |
readObject(ObjectInputStream in) |
static Object |
resolveNumericValue(Object srcValue,
Class destClass)
Deprecated.
Use adjustPrimitiveValue() instead
|
protected Object |
toObject(AbsObject abs,
String lcType,
Ontology referenceOnto)
This method is redefined as BasicOntology does not use an
Introspector for performance reason
|
add, add, checkIsTerm, createConceptSlotFunction, externalize, externalizeSlotValue, fromObject, getActionNames, getClassForElement, getConceptNames, getIntrospector, getName, getOwnActionNames, getOwnConceptNames, getOwnPredicateNames, getPredicateNames, getSlotValue, internalize, internalizeSlotValue, setSlotValue, toObject, toString, useConceptSlotsAsFunctions
private static final BasicOntology theInstance
public static final String STRING
public static final String FLOAT
public static final String INTEGER
public static final String BOOLEAN
public static final String DATE
public static final String BYTE_SEQUENCE
public static final String CONTENT_ELEMENT_LIST
private transient Map primitiveSchemas
private void initialize()
private void fillPrimitiveSchemas() throws OntologyException
OntologyException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static Ontology getInstance()
BasicOntology
.BasicOntology
protected Object toObject(AbsObject abs, String lcType, Ontology referenceOnto) throws UngroundedException, OntologyException
toObject
in class Ontology
abs
- the abstract descriptor.lcType
- the type of the abstract descriptor to be translated
aconverted into lower case. This is passed as parameters to avoid
making the conversion to lower case for each base ontology.referenceOnto
- The ontology this ontology is part of (i.e. the
ontology that extends this ontology).UngroundedException
- if the abstract descriptor contains a
variableUnknownSchemaException
- If no schema for the abs descriptor
to be translated is defined in this ontology.OntologyException
- if some mismatch with the schema is found * ontology. In this case UnknownSchemaOntology.toObject(AbsObject)
protected AbsObject fromObject(Object obj, Ontology referenceOnto) throws OntologyException
fromObject
in class Ontology
obj
- the objectreferenceOnto
- The ontology this ontology is part of (i.e. the
ontology that extends this ontology).UnknownSchemaException
- If no schema for the object to be
translated is defined in this ontology.OntologyException
- if some mismatch with the schema is foundOntology.toObject(AbsObject)
public ObjectSchema getSchema(String name) throws OntologyException
getSchema()
method to take into
account ACL performatives.getSchema
in class Ontology
name
- the name of the schema in the vocabulary.null
if the schema is not found.OntologyException
public ObjectSchema getSchema(Class clazz) throws OntologyException
getSchema()
method to take into
account java primitives.getSchema
in class Ontology
clazz
- the class whose associated schema must be retrieved.null
if the schema is not found.OntologyException
private ObjectSchema createMsgSchema(String performative) throws OntologyException
OntologyException
public static Object adjustPrimitiveValue(Object srcValue, Class destClass)