public void objectAdded(Object id, OAVObjectType type, boolean root) { // Add the type and its supertypes (if not already contained). while(type!=null && types.add(type)) type = type.getSupertype(); }
/** * Get an attribute type description. * @param attribute The name of the attribute. * @return The OAV attribute type. */ public OAVAttributeType getAttributeType0(String attribute) { OAVAttributeType ret = (OAVAttributeType)(attributes!=null? attributes.get(attribute): null); if(ret==null) { OAVObjectType type = this.getSupertype(); while(ret==null && type!=null) { ret = type.getAttributeType0(attribute); type = type.getSupertype(); } } return ret; }
/** * Get an attribute type description. * @param attribute The name of the attribute. * @return The OAV attribute type. */ public OAVAttributeType getAttributeType0(String attribute) { OAVAttributeType ret = (OAVAttributeType)(attributes!=null? attributes.get(attribute): null); if(ret==null) { OAVObjectType type = this.getSupertype(); while(ret==null && type!=null) { ret = type.getAttributeType0(attribute); type = type.getSupertype(); } } return ret; }
/** * Test if this type is same type or subtype of another type. * @param type The type to test. * @return True, if this object is same type or subtype. */ public boolean isSubtype(OAVObjectType type) { boolean ret = false; OAVObjectType tmp = this; while(tmp!=null && !ret) { if(type.equals(tmp)) ret = true; else tmp = tmp.getSupertype(); } return ret; }
/** * Test if this type is same type or subtype of another type. * @param type The type to test. * @return True, if this object is same type or subtype. */ public boolean isSubtype(OAVObjectType type) { boolean ret = false; OAVObjectType tmp = this; while(tmp!=null && !ret) { if(type.equals(tmp)) ret = true; else tmp = tmp.getSupertype(); } return ret; }
/** * Get the properties of an object. */ protected Collection getProperties(Object object, IContext context, boolean includemethods, boolean includefields) { Collection ret = new LinkedHashSet(); IOAVState state = (IOAVState)context; OAVObjectType type = state.getType(object); while(type!=null && !(type instanceof OAVJavaType)) { Collection props = type.getDeclaredAttributeTypes(); ret.addAll(props); type = type.getSupertype(); } return ret; }
/** * Get the properties of an object. */ protected Collection getProperties(Object object, IContext context, boolean includemethods, boolean includefields) { Collection ret = new LinkedHashSet(); IOAVState state = (IOAVState)context; OAVObjectType type = state.getType(object); while(type!=null && !(type instanceof OAVJavaType)) { Collection props = type.getDeclaredAttributeTypes(); ret.addAll(props); type = type.getSupertype(); } return ret; }
type = type.getSupertype();
type = type.getSupertype();
tmptype = tmptype.getSupertype();
tmptype = tmptype.getSupertype();
tmptype = tmptype.getSupertype();
tmptype = tmptype.getSupertype();