Package jade.content.abs

Examples of jade.content.abs.AbsObject


  public AbsObject externalizeSpecialType(Object obj, ObjectSchema schema, Class javaClass, Ontology referenceOnto) throws OntologyException {
    if (!javaClass.isEnum()) {
      throw new NotASpecialType();
    }
   
    AbsObject abs = schema.newInstance();
    AbsHelper.setAttribute(abs, ENUM_SLOT_NAME, AbsPrimitive.wrap(obj.toString()));
    return abs;
  }
View Full Code Here


    // Finally manage "local" slots through the introspector
    if (introspector != null) {
      String[] names = schema.getOwnNames();
      for (int i = 0; i < names.length; ++i) {
        String slotName = names[i];
        AbsObject absSlotValue = abs.getAbsObject(slotName);
        if (absSlotValue != null) {
          Object slotValue = null;
          if (absSlotValue.getAbsType() == AbsObject.ABS_AGGREGATE) {
            // Manage as aggregate
            slotValue = introspector.internalizeAggregate(slotName, (AbsAggregate)absSlotValue, schema, globalOnto);
          } else {
            // Manage as normal slot
            slotValue = globalOnto.toObject(absSlotValue);
View Full Code Here

    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();
View Full Code Here

      for (int i = 0; i < names.length; ++i) {
        String slotName = names[i];
        Object slotValue = introspector.getSlotValue(slotName, obj, schema);
        if (slotValue != null) {
          // Try to manage as aggregate
          AbsObject absSlotValue = null;
          try {
            absSlotValue = introspector.externalizeAggregate(slotName, slotValue, schema, globalOnto);
          } catch(NotAnAggregate naa) {
            // Manage as normal slot
            absSlotValue = globalOnto.fromObject(slotValue);
View Full Code Here

TOP

Related Classes of jade.content.abs.AbsObject

Copyright © 2018 www.massapicom. 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.