/** * Warning: to be used only by Apform for removing internal attributes. Only Inhibits the message * "Attribute " + attr + " is an program field attribute and cannot be removed."); */ public boolean removeProperty(String attr, boolean forced) { String oldValue = getProperty(attr); if (oldValue == null) { logger.error("ERROR: \"" + attr + "\" not instanciated"); return false; } if (Attribute.isFinalAttribute(attr)) { logger.error("ERROR: \"" + attr + "\" is a final attribute"); return false; } if (Attribute.isReservedAttributePrefix(attr)) { logger.error("ERROR: \"" + attr + "\" is a reserved attribute"); return false; } PropertyDefinition propDef = getAttrDefinition(attr); if (propDef != null && propDef.getField() != null && !forced) { logger.error( "In " + this + " attribute " + attr + " is a program field and cannot be removed."); return false; } if (getGroup() != null && getGroup().getProperty(attr) != null) { logger.error("In " + this + " attribute " + attr + " inherited and cannot be removed."); return false; } // it is ok, remove it and propagate to members, recursively propagateRemove(attr); // TODO. Should we notify at all levels ? ApamManagers.notifyAttributeRemoved(this, attr, oldValue); return true; }