Examples of ObjectSchema


Examples of jade.content.schema.ObjectSchema

    if (logger.isLoggable(Logger.FINE)) {
      logger.log(Logger.FINE, "concept "+schema.getTypeName()+": adding slot "+slotName);
    }
   
    if (!sad.aggregate) {
      ObjectSchema os = doAddSchema(sad.type, buildHierarchy, sad.manageAsSerializable);
      schema.add(slotName, os, sad.mandatory ? ObjectSchema.MANDATORY : ObjectSchema.OPTIONAL);
     
      if (sad.defaultValue != null) {
        schema.addFacet(slotName, new DefaultValueFacet(sad.defaultValue));
      }
View Full Code Here

Examples of jade.content.schema.ObjectSchema

    int scms = clazz.getModifiers();
    return Modifier.isPrivate(scms);
  }

  private ObjectSchema createEmptySchema(Class clazz) {
    ObjectSchema schema;
    String schemaName = getSchemaNameFromClass(clazz);
    if (logger.isLoggable(Logger.FINE)) {
      logger.log(Logger.FINE, "building concept "+schemaName);
    }
    if (AgentAction.class.isAssignableFrom(clazz)) {
View Full Code Here

Examples of jade.content.schema.ObjectSchema

  public ObjectSchema getSchema(String name) throws OntologyException {
    if (name == null) {
      throw new OntologyException("Null schema identifier");
    }

    ObjectSchema ret = (ObjectSchema) elements.get(name.toLowerCase());
       
    if (ret == null) {
      // Check if a ConceptSlotFunctionSchema must be returned
      if ("BC-Ontology".equals(getName())) {
        System.out.println("Searching for schema "+name);
View Full Code Here

Examples of jade.content.schema.ObjectSchema

   */
  public ObjectSchema getSchema(Class clazz) throws OntologyException {
    if (clazz == null) {
      throw new OntologyException("Null class");
    }
    ObjectSchema ret = (ObjectSchema) schemas.get(clazz);
    if (ret == null) {
      if(logger.isLoggable(Logger.FINE))
        logger.log(Logger.FINE,"Ontology "+getName()+". Schema for class "+clazz+" not found");
      for (int i = 0; i < base.length; ++i) {
        if (base[i] == null) {
View Full Code Here

Examples of jade.content.schema.ObjectSchema

  protected Object toObject(AbsObject abs, String lcType, Ontology globalOnto) throws UnknownSchemaException, UngroundedException, OntologyException {
    if(logger.isLoggable(Logger.FINE))
      logger.log(Logger.FINE,"Ontology "+getName()+". Translating ABS descriptor "+abs);

    // Retrieve the schema
    ObjectSchema schema = (ObjectSchema) elements.get(lcType);
    if (schema != null) {
      if(logger.isLoggable(Logger.FINE))
        logger.log(Logger.FINE,"Ontology "+getName()+". Schema for type "+abs.getTypeName()+" found locally: "+schema);

      // Retrieve the java class
View Full Code Here

Examples of jade.content.schema.ObjectSchema

   */
  protected void internalize(AbsObject abs, Object obj, ObjectSchema schema, Ontology globalOnto) throws OntologyException {
    // Let the proper ontology manage slots defined in super schemas if any
    ObjectSchema[] superSchemas = schema.getSuperSchemas();
    for (int i = 0; i < superSchemas.length; ++i) {
      ObjectSchema superSchema = superSchemas[i];
      Ontology definingOntology = getDefiningOntology(superSchema.getTypeName().toLowerCase());
      if (definingOntology != null) {
        definingOntology.internalize(abs, obj, superSchema, globalOnto);
      }
    }
   
View Full Code Here

Examples of jade.content.schema.ObjectSchema

    Class javaClass = obj.getClass();
    if(logger.isLoggable(Logger.FINE))
      logger.log(Logger.FINE,"Ontology "+getName()+". Translating object of class "+javaClass);

    // Retrieve the schema
    ObjectSchema schema = (ObjectSchema) schemas.get(javaClass);
    if (schema != null) {
      if(logger.isLoggable(Logger.FINE))
        logger.log(Logger.FINE,"Ontology "+getName()+". Schema for class "+javaClass+" found locally: "+schema);

      // Try to manage as special type
      AbsObject abs = null;
      try {
        abs = externalizeSpecialType(obj, schema, javaClass, globalOnto);
      } catch(NotASpecialType nasp) {
        // Manage as structure slot
        abs = schema.newInstance();
        externalize(obj, abs, schema, globalOnto);
      }
      return abs;
    }
View Full Code Here

Examples of jade.content.schema.ObjectSchema

   */
  protected void externalize(Object obj, AbsObject abs, ObjectSchema schema, Ontology globalOnto) throws OntologyException {
    // Let the proper ontology manage slots defined in super schemas if any
    ObjectSchema[] superSchemas = schema.getSuperSchemas();
    for (int i = 0; i < superSchemas.length; ++i) {
      ObjectSchema superSchema = superSchemas[i];
      Ontology definingOntology = getDefiningOntology(superSchema.getTypeName().toLowerCase());
      if (definingOntology != null) {
        definingOntology.externalize(obj, abs, superSchema, globalOnto);
      }
    }
   
View Full Code Here

Examples of jade.content.schema.ObjectSchema

  /**
   * Set the value of slot <code>slotName</code> as <code>slotValue</code> to object <code>obj</code>
   */
  public void setSlotValue(String slotName, Object slotValue, Object obj) throws OntologyException {
    Class javaClass = obj.getClass();
    ObjectSchema schema = (ObjectSchema) schemas.get(javaClass);
    if (schema != null) {
      setSlotValue(slotName, slotValue, obj, schema);
      return;
    }

View Full Code Here

Examples of jade.content.schema.ObjectSchema

  /**
   * Retrieve the value of slot <code>slotName</code> from object <code>obj</code>
   */
  public Object getSlotValue(String slotName, Object obj) throws OntologyException {
    Class javaClass = obj.getClass();
    ObjectSchema schema = (ObjectSchema) schemas.get(javaClass);
    if (schema != null) {
      return getSlotValue(slotName, obj, schema);
    }

    // The schema must be defined in a super-ontology --> let it do the job
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.