Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 protected Association getFUMLAssociation(EReference eReference) {
   Association association = (Association) conversionResult.getFUMLElement(eReference);
   return association;
 }
Exemplo n.º 4
0
 protected Property getFUMLProperty(EAttribute eAttribute) {
   Property property = (Property) conversionResult.getFUMLElement(eAttribute);
   return property;
 }
Exemplo n.º 5
0
 protected Class_ getFumlType(EObject eObject) {
   return (Class_) conversionResult.getFUMLElement(eObject.eClass());
 }