24
 Eclipse UML2 Project  |  Technology Exchange  |  © 2004 IBM Corporation
Element Retrieval Example
Property property = clazz.getOwnedAttribute("myProperty");
// instead of
Property property = null;
for (Iterator attributes = clazz.getOwnedAttributes().iterator();
  attributes.hasNext();) {
    Property attribute = (Property) attributes.next();
    if ("myProperty".equals(attribute.getName())) {
        property = attribute;
        break;
    }
}