public Property createProperty(String name, Classifier resultType) { Property result = UMLFactory.eINSTANCE.createProperty(); result.setName(name); result.setType(resultType); return result; }
@Override public Object caseEAttribute(EAttribute eAttribute) { EClass eContainingClass = eAttribute.getEContainingClass(); if (eContainingClass != null) { Property property = UMLFactory.eINSTANCE.createProperty(); eModelElementToElementMap.put(eAttribute, property); Classifier classifier = (Classifier) doSwitch(eContainingClass); getOwnedAttributes(classifier).add(property); property.setName(eAttribute.getName()); property.setIsReadOnly(!eAttribute.isChangeable()); property.setIsDerived(eAttribute.isDerived()); property.setVisibility(VisibilityKind.PUBLIC_LITERAL); caseETypedElement(eAttribute); defaultCase(eAttribute); return property; } return super.caseEAttribute(eAttribute); }
public Property defineAttribute(Classifier owner, Variable<Classifier, Parameter> variable, Constraint constraint) { resetTypeCaches(); Property result; String name = variable.getName(); Classifier type = variable.getType(); result = UMLFactory.eINSTANCE.createProperty(); result.addKeyword(UMLReflection.OCL_HELPER); result.setName(name); result.setType(type); annotate(result, constraint); addHelperProperty(owner, result); return result; }
Property property = UMLFactory.eINSTANCE.createProperty(); eModelElementToElementMap.put(eReference, property);