diff options
author | 2020-05-11 22:03:54 +0200 | |
---|---|---|
committer | 2020-05-11 22:03:54 +0200 | |
commit | 09c0f7bd18e6cec7f8e37bd2bcac9849636d33d1 (patch) | |
tree | 0b51ffc70d41ff11e17036c2957275cff024a9e1 /Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend | |
parent | fix for inverse references (diff) | |
download | VIATRA-Generator-09c0f7bd18e6cec7f8e37bd2bcac9849636d33d1.tar.gz VIATRA-Generator-09c0f7bd18e6cec7f8e37bd2bcac9849636d33d1.tar.zst VIATRA-Generator-09c0f7bd18e6cec7f8e37bd2bcac9849636d33d1.zip |
Bigliteral serialization in xmi transformation fixed
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend')
-rw-r--r-- | Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend index 92deeae6..08c6b7b7 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend | |||
@@ -20,6 +20,8 @@ import org.eclipse.emf.ecore.EcorePackage | |||
20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription | 20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription |
21 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder | 21 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder |
22 | import java.util.Map | 22 | import java.util.Map |
23 | import org.eclipse.emf.ecore.EAttribute | ||
24 | import java.math.BigDecimal | ||
23 | 25 | ||
24 | class Logic2Ecore { | 26 | class Logic2Ecore { |
25 | val extension LogicStructureBuilder structureBuilder = new LogicStructureBuilder | 27 | val extension LogicStructureBuilder structureBuilder = new LogicStructureBuilder |
@@ -92,7 +94,7 @@ class Logic2Ecore { | |||
92 | list += l.key | 94 | list += l.key |
93 | } else { | 95 | } else { |
94 | try { | 96 | try { |
95 | sourceObject.eSet(attributeType,l.key) | 97 | sourceObject.eSet(attributeType,translateType(attributeType.EAttributeType,l.key)) |
96 | } catch(Exception e) { | 98 | } catch(Exception e) { |
97 | e.printStackTrace | 99 | e.printStackTrace |
98 | } | 100 | } |
@@ -107,6 +109,16 @@ class Logic2Ecore { | |||
107 | return element2Object.values.root | 109 | return element2Object.values.root |
108 | } | 110 | } |
109 | 111 | ||
112 | def translateType(EDataType type, Object value) { | ||
113 | if(type == EcorePackage.eINSTANCE.EFloat) { | ||
114 | val bd = value as BigDecimal | ||
115 | return bd.floatValue | ||
116 | } else if( type == EcorePackage.eINSTANCE.EDouble ) { | ||
117 | val bd = value as BigDecimal | ||
118 | return bd.doubleValue | ||
119 | } else return value | ||
120 | } | ||
121 | |||
110 | 122 | ||
111 | // if(attributeType.EAttributeType.isSuperTypeOf(targetObject.eClass)) { | 123 | // if(attributeType.EAttributeType.isSuperTypeOf(targetObject.eClass)) { |
112 | // val expression = ecore2Logic.IsAttributeValue(forwardTrace,sourceElement,targetElement,attributeType) | 124 | // val expression = ecore2Logic.IsAttributeValue(forwardTrace,sourceElement,targetElement,attributeType) |