/** * Add a Java object as root object. * @param object The Java object. */ public void addJavaRootObject(Object object) { assert nocheck || !rootobjects.contains(object); this.rootobjects.add(object); OAVJavaType java_type = tmodel.getJavaType(object.getClass()); if(OAVJavaType.KIND_BEAN.equals(java_type.getKind())) registerValue(java_type, object); eventhandler.objectAdded(object, java_type, true); }
/** * Add a Java object as root object. * @param object The Java object. */ public void addJavaRootObject(Object object) { assert nocheck || !rootobjects.contains(object); this.rootobjects.add(object); OAVJavaType java_type = tmodel.getJavaType(object.getClass()); if(OAVJavaType.KIND_BEAN.equals(java_type.getKind())) registerValue(java_type, object); eventhandler.objectAdded(object, java_type, true); }
/** * Impl of root/non-root object creation. */ protected Object createObject(OAVObjectType type, boolean root) { // #ifndef MIDP assert nocheck || checkTypeDefined(type); // #endif Object ret = generator.createId(this, type); // Map content = new LinkedHashMap(); // objects.put(ret, content); Map content = internalCreateObject(ret); content.put(TYPE, type); // System.out.println("Created object of type: "+type); eventhandler.objectAdded(ret, type, root); if(root) this.rootobjects.add(ret); return ret; }
/** * Add a Java object as root object. * @param object The Java object. */ public void addJavaRootObject(Object object) { // #ifndef MIDP assert nocheck || !generator.isId(object); assert nocheck || !rootobjects.contains(object); // #endif OAVJavaType java_type = tmodel.getJavaType(object.getClass()); if(OAVJavaType.KIND_VALUE.equals(java_type.getKind())) throw new RuntimeException("Value types not supported for Java root objects: "+java_type+", "+object); this.rootobjects.add(object); if(this.javaobjects.add(object)) // Todo: java objects in nested states. { if(OAVJavaType.KIND_BEAN.equals(java_type.getKind())) registerValue(java_type, object); eventhandler.objectAdded(object, java_type, true); } }
eventhandler.objectAdded(value, java_type, false);
/** * Create an object. * Creates an object identifier that can be used * to store/retrieve attribute values. * May reuse old object identifiers for performance. * @return An object identifier. */ public Object createObject(OAVObjectType type) { assert nocheck || checkTypeDefined(type); OAVInternalObjectId ret = (OAVInternalObjectId)generator.createId(this, type); objects.put(ret, new LinkedHashMap()); types.put(ret, type); //System.out.println("Adding type: "+type); // Event should be thrown once the object is used somewhere in the state? eventhandler.objectAdded(ret.getPhantomExternalId(), type, false); return ret.getWeakExternalId(); }
/** * Create a root object. A root object will not be automatically * garbage collected when no references point to this object * any longer. * Creates an object identifier that can be used * to store/retrieve attribute values. * May reuse old object identifiers for performance. * @return An object identifier. */ public Object createRootObject(OAVObjectType type) { Object ret = createObject(type); this.rootobjects.add(ret); eventhandler.objectAdded(((OAVExternalObjectId)ret).getInternalId().getPhantomExternalId(), type, true); assert ret instanceof OAVExternalObjectId; return ret; }
/** * Create a root object. A root object will not be automatically * garbage collected when no references point to this object * any longer. * Creates an object identifier that can be used * to store/retrieve attribute values. * May reuse old object identifiers for performance. * @return An object identifier. */ public Object createRootObject(OAVObjectType type) { Object ret = createObject(type); this.rootobjects.add(ret); eventhandler.objectAdded(((OAVExternalObjectId)ret).getInternalId().getPhantomExternalId(), type, true); assert ret instanceof OAVExternalObjectId; return ret; }
/** * Impl of root/non-root object creation. */ protected Object createObject(OAVObjectType type, boolean root) { // #ifndef MIDP assert nocheck || checkTypeDefined(type); // #endif Object ret = generator.createId(this, type); // Map content = new LinkedHashMap(); // objects.put(ret, content); Map content = internalCreateObject(ret); content.put(TYPE, type); // System.out.println("Created object of type: "+type); eventhandler.objectAdded(ret, type, root); if(root) this.rootobjects.add(ret); return ret; }
/** * Add a Java object as root object. * @param object The Java object. */ public void addJavaRootObject(Object object) { // #ifndef MIDP assert nocheck || !generator.isId(object); assert nocheck || !rootobjects.contains(object); // #endif OAVJavaType java_type = tmodel.getJavaType(object.getClass()); if(OAVJavaType.KIND_VALUE.equals(java_type.getKind())) throw new RuntimeException("Value types not supported for Java root objects: "+java_type+", "+object); this.rootobjects.add(object); if(this.javaobjects.add(object)) // Todo: java objects in nested states. { if(OAVJavaType.KIND_BEAN.equals(java_type.getKind())) registerValue(java_type, object); eventhandler.objectAdded(object, java_type, true); } }
eventhandler.objectAdded(value, java_type, false);
/** * Create an object. * Creates an object identifier that can be used * to store/retrieve attribute values. * May reuse old object identifiers for performance. * @return An object identifier. */ public Object createObject(OAVObjectType type) { assert nocheck || checkTypeDefined(type); OAVInternalObjectId ret = (OAVInternalObjectId)generator.createId(this, type); objects.put(ret, new LinkedHashMap()); types.put(ret, type); //System.out.println("Adding type: "+type); // Event should be thrown once the object is used somewhere in the state? eventhandler.objectAdded(ret.getPhantomExternalId(), type, false); return ret.getWeakExternalId(); }
registerValue(java_type, value); eventhandler.objectAdded(value, java_type, false);
registerValue(java_type, value); eventhandler.objectAdded(value, java_type, false);