/** * Test if the object is a valid state value, meaning * that is either a state object or a java value. * @param value The value. * @return True, if valid. */ protected boolean checkValidStateValue(Object value) { // No state object (i.e. Java object) or object in state. return !generator.isId(value) || checkValidStateObject(value); }
/** * Test if the object is a valid state value, meaning * that is either a state object or a java value. * @param value The value. * @return True, if valid. */ protected boolean checkValidStateValue(Object value) { // No state object (i.e. Java object) or object in state. return !generator.isId(value) || checkValidStateObject(value); }
/** * Test if reading the object (oid) is allowed. * Reading is allowed on removed objects as long as there are external references. * @param id The object (oid). * @return True, if valid. */ protected boolean checkValidStateObjectRead(Object id) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif return checkValidStateObject(id) || isExternallyUsed(id); }
/** * Test if reading the object (oid) is allowed. * Reading is allowed on removed objects as long as there are external references. * @param id The object (oid). * @return True, if valid. */ protected boolean checkValidStateObjectRead(Object id) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif return checkValidStateObject(id) || isExternallyUsed(id); }
assert nocheck || checkValidStateObject(id);
assert nocheck || checkValidStateObject(id);
assert nocheck || checkValidStateObject(id); assert nocheck || checkValidStateValue(value) : value; assert nocheck || checkTypeHasAttribute(id, attribute);
assert nocheck || checkValidStateObject(id); assert nocheck || checkValidStateValue(value) : value; assert nocheck || checkTypeHasAttribute(id, attribute);
assert nocheck || checkValidStateObject(id); assert nocheck || checkValidStateValue(value); assert nocheck || checkTypeHasAttribute(id, attribute);
assert nocheck || checkValidStateObject(id); assert nocheck || checkValidStateValue(value); assert nocheck || checkTypeHasAttribute(id, attribute);
/** * Set an attribute of an object (oid) to the given value. * @param id The identifier of the object. * @param attribute The attribute identifier. * @param value The value (basic, object id or java object). */ public void setAttributeValue(Object id, OAVAttributeType attribute, Object value) { // #ifndef MIDP assert nocheck || generator.isId(id); assert nocheck || checkValidStateObject(id): id+" "+attribute+" "+value; assert nocheck || checkValidStateValue(value); assert nocheck || checkTypeHasAttribute(id, attribute); assert nocheck || checkMultiplicity(id, attribute, OAVAttributeType.NONE); assert nocheck || checkValueCompatibility(id, attribute, value); // #endif Map theobject = getObject(id); Object oldvalue = theobject.put(attribute, value); // Notification before removal in order to be capable to save the oldvalue reference. if(!equals(oldvalue, value)) { eventhandler.objectModified(id, getType(id), attribute, oldvalue, value); removeObjectUsage(id, attribute, oldvalue, null, false); addObjectUsage(id, attribute, value); } }
/** * Set an attribute of an object (oid) to the given value. * @param id The identifier of the object. * @param attribute The attribute identifier. * @param value The value (basic, object id or java object). */ public void setAttributeValue(Object id, OAVAttributeType attribute, Object value) { // #ifndef MIDP assert nocheck || generator.isId(id); assert nocheck || checkValidStateObject(id): id+" "+attribute+" "+value; assert nocheck || checkValidStateValue(value); assert nocheck || checkTypeHasAttribute(id, attribute); assert nocheck || checkMultiplicity(id, attribute, OAVAttributeType.NONE); assert nocheck || checkValueCompatibility(id, attribute, value); // #endif Map theobject = getObject(id); Object oldvalue = theobject.put(attribute, value); // Notification before removal in order to be capable to save the oldvalue reference. if(!equals(oldvalue, value)) { eventhandler.objectModified(id, getType(id), attribute, oldvalue, value); removeObjectUsage(id, attribute, oldvalue, null, false); addObjectUsage(id, attribute, value); } }