private EnumerationLiteral getEnumerationLiteral(Object value, EDataType valueType) { Enumeration enumeration = (Enumeration) conversionResult.getFUMLElement(valueType); Enumerator enumerator = (Enumerator) value; for (EnumerationLiteral enumerationLiteral : enumeration.ownedLiteral) { if (enumerationLiteral.name.equals(enumerator.getLiteral())) return enumerationLiteral; } return null; }
public Value createFUMLValue(Object value, EDataType valueType) { Value fUMLValue = null; if (value != null) { if (isEStringType(valueType) || isUMLStringType(valueType)) { StringValue stringValue = new StringValue(); stringValue.value = (String) value; fUMLValue = stringValue; } else if (isEBooleanType(valueType) || isUMLBooleanType(valueType)) { BooleanValue booleanValue = new BooleanValue(); booleanValue.value = (Boolean) value; fUMLValue = booleanValue; } else if (isEIntType(valueType) || isUMLIntegerType(valueType)) { IntegerValue integerValue = new IntegerValue(); integerValue.value = (int) value; fUMLValue = integerValue; } else if (isCustomEEnumType(valueType)) { EnumerationValue enumerationValue = new EnumerationValue(); enumerationValue.literal = getEnumerationLiteral(value, valueType); enumerationValue.type = (Enumeration) conversionResult.getFUMLElement(valueType); fUMLValue = enumerationValue; } } return fUMLValue; }
protected Association getFUMLAssociation(EReference eReference) { Association association = (Association) conversionResult.getFUMLElement(eReference); return association; }
protected Property getFUMLProperty(EAttribute eAttribute) { Property property = (Property) conversionResult.getFUMLElement(eAttribute); return property; }
protected Class_ getFumlType(EObject eObject) { return (Class_) conversionResult.getFUMLElement(eObject.eClass()); }