/** * Get the default value. */ protected Object getDefaultValue(Object property) { Object ret = null; if(property instanceof OAVAttributeType) ret = ((OAVAttributeType)property).getDefaultValue(); else ret = super.getDefaultValue(property); return ret; }
/** * Get the default value. */ protected Object getDefaultValue(Object property) { Object ret = null; if(property instanceof OAVAttributeType) ret = ((OAVAttributeType)property).getDefaultValue(); else ret = super.getDefaultValue(property); return ret; }
/** * Get the keys of an attribute of an object. * @param object The identifier of the object. * @param attribute The attribute identifier. * @return The keys for which values are stored. */ public Collection getAttributeKeys(Object object, OAVAttributeType attribute) { assert nocheck || checkTypeHasAttribute(object, attribute); assert nocheck || checkMultiplicity(object, attribute, OAVAttributeType.MULTIPLICITIES_MAPS); assert nocheck || checkValidStateObject(object); assert object instanceof OAVExternalObjectId; Map theobject = getObject(object); Object ret = theobject.get(attribute); if(ret==null && !theobject.containsKey(attribute)) ret = attribute.getDefaultValue(); return ret!=null ? ((Map)ret).keySet(): Collections.emptySet(); }
/** * Get the keys of an attribute of an object. * @param object The identifier of the object. * @param attribute The attribute identifier. * @return The keys for which values are stored. */ public Collection getAttributeKeys(Object object, OAVAttributeType attribute) { assert nocheck || checkTypeHasAttribute(object, attribute); assert nocheck || checkMultiplicity(object, attribute, OAVAttributeType.MULTIPLICITIES_MAPS); assert nocheck || checkValidStateObject(object); assert object instanceof OAVExternalObjectId; Map theobject = getObject(object); Object ret = theobject.get(attribute); if(ret==null && !theobject.containsKey(attribute)) ret = attribute.getDefaultValue(); return ret!=null ? ((Map)ret).keySet(): Collections.emptySet(); }
/** * Get the values of an attribute of an object. * @param object The identifier of the object. * @param attribute The attribute identifier. * @return The values (basic, object ids or java objects). */ public Collection getAttributeValues(Object object, OAVAttributeType attribute) { assert nocheck || checkTypeHasAttribute(object, attribute); assert nocheck || checkMultiplicity(object, attribute, OAVAttributeType.MULTIPLICITIES_MULT); assert nocheck || checkValidStateObject(object); assert object instanceof OAVExternalObjectId; Map theobject = getObject(object); Object ret = theobject.get(attribute); if(ret==null && !theobject.containsKey(attribute)) ret = attribute.getDefaultValue(); return (ret instanceof Map)? ((Map)ret).values(): (Collection)ret; }
/** * Get the values of an attribute of an object. * @param object The identifier of the object. * @param attribute The attribute identifier. * @return The values (basic, object ids or java objects). */ public Collection getAttributeValues(Object object, OAVAttributeType attribute) { assert nocheck || checkTypeHasAttribute(object, attribute); assert nocheck || checkMultiplicity(object, attribute, OAVAttributeType.MULTIPLICITIES_MULT); assert nocheck || checkValidStateObject(object); assert object instanceof OAVExternalObjectId; Map theobject = getObject(object); Object ret = theobject.get(attribute); if(ret==null && !theobject.containsKey(attribute)) ret = attribute.getDefaultValue(); return (ret instanceof Map)? ((Map)ret).values(): (Collection)ret; }
/** * Get an attribute value of an object. * @param object The identifier of the object. * @param attribute The attribute identifier. * @return The value (basic, object id or java object). */ public Object getAttributeValue(Object object, OAVAttributeType attribute) { assert nocheck || checkTypeHasAttribute(object, attribute); assert nocheck || checkMultiplicity(object, attribute, OAVAttributeType.NONE); assert nocheck || checkValidStateObject(object); assert object instanceof OAVExternalObjectId: object; Map theobject = getObject(object); Object ret = theobject.get(attribute); if(ret==null && !theobject.containsKey(attribute)) ret = attribute.getDefaultValue(); if(ret instanceof Collection) throw new IllegalArgumentException("Attribute "+attribute+" is not single valued."); return ret; }
/** * Get an attribute value of an object. * @param object The identifier of the object. * @param attribute The attribute identifier. * @return The value (basic, object id or java object). */ public Object getAttributeValue(Object object, OAVAttributeType attribute) { assert nocheck || checkTypeHasAttribute(object, attribute); assert nocheck || checkMultiplicity(object, attribute, OAVAttributeType.NONE); assert nocheck || checkValidStateObject(object); assert object instanceof OAVExternalObjectId: object; Map theobject = getObject(object); Object ret = theobject.get(attribute); if(ret==null && !theobject.containsKey(attribute)) ret = attribute.getDefaultValue(); if(ret instanceof Collection) throw new IllegalArgumentException("Attribute "+attribute+" is not single valued."); return ret; }
val = attribute.getDefaultValue();
val = attribute.getDefaultValue();
ret = attribute.getDefaultValue();
val = attribute.getDefaultValue();
val = attribute.getDefaultValue();
ret = attribute.getDefaultValue();