summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormclay2009-02-05 01:57:17 (EST)
committer sefftinge2009-02-05 01:57:17 (EST)
commita66286a6f296f702a49e5bdabbab3d5ad821484f (patch)
tree52dd77b26124820ebc9ceaa75efae56222c87f7b
parent1ebe78c1110a07cc879c9deadc413a451deb7211 (diff)
downloadorg.eclipse.xtext-a66286a6f296f702a49e5bdabbab3d5ad821484f.zip
org.eclipse.xtext-a66286a6f296f702a49e5bdabbab3d5ad821484f.tar.gz
org.eclipse.xtext-a66286a6f296f702a49e5bdabbab3d5ad821484f.tar.bz2
add: some comments
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl/src/org/eclipse/xtext/example/EcoreDslRuntimeModule.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src/org/eclipse/xtext/example/EcoreDslRuntimeModule.java b/examples/org.eclipse.xtext.example.ecoredsl/src/org/eclipse/xtext/example/EcoreDslRuntimeModule.java
index 544d26f..0a2179e 100644
--- a/examples/org.eclipse.xtext.example.ecoredsl/src/org/eclipse/xtext/example/EcoreDslRuntimeModule.java
+++ b/examples/org.eclipse.xtext.example.ecoredsl/src/org/eclipse/xtext/example/EcoreDslRuntimeModule.java
@@ -79,6 +79,7 @@ public class EcoreDslRuntimeModule extends AbstractEcoreDslRuntimeModule {
@Override
protected void setDefaultValueImpl(EObject obj, EReference ref, IDiagnosticProducer producer) {
+ //hack: ePackage always needs an eFactoryInstance (gets cleared in #clearReferences?)
if (ref.getName().equalsIgnoreCase("eFactoryInstance")) {
((EPackage) obj).setEFactoryInstance(EcoreFactoryImpl.eINSTANCE.createEFactory());
}
@@ -88,8 +89,8 @@ public class EcoreDslRuntimeModule extends AbstractEcoreDslRuntimeModule {
protected void clearReferences(EObject obj) {
EList<EReference> allReferences = obj instanceof EClass ? ((EClass) obj).getEAllReferences() : obj.eClass()
.getEAllReferences();
+ // hack: exceptions when eType, eExceptions are null
for (EReference ref : allReferences) {
-
try {
if (ref.isContainment() ||
ref.isContainer() ||
@@ -113,20 +114,10 @@ public class EcoreDslRuntimeModule extends AbstractEcoreDslRuntimeModule {
// logger available to subclasses
protected final Logger logger = Logger.getLogger(getClass());
- // @Override
- // public EObject create(String fullTypeName) {
- // EObject create = super.create(fullTypeName);
- // if (create instanceof EPackage) {
- // EFactory factoryInstance = ((EPackage) create).getEFactoryInstance();
- // ((EPackage) create).setEFactoryInstance(factoryInstance);
- // }
- // return create;
- // }
-
@Override
public void set(EObject _this, String feature, Object value, String ruleName, AbstractNode node)
throws ValueConverterException {
-
+ // hack: negated boolean assignments (not possible out of the box with xtext)
if (ruleName.equals("readonly")) {
((EStructuralFeature) _this).setChangeable(false);
return;