-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate SymTypeExpression DeSer attributes by default
- Loading branch information
Showing
5 changed files
with
46 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...de/monticore/codegen/cd2java/_symboltable/serialization/SymTypeExpressionSerStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* (c) https://github.com/MontiCore/monticore */ | ||
package de.monticore.codegen.cd2java._symboltable.serialization; | ||
|
||
import de.monticore.generating.templateengine.HookPoint; | ||
import de.monticore.generating.templateengine.StringHookPoint; | ||
import de.monticore.types.check.SymTypeExpression; | ||
|
||
/** | ||
* DeSerialization of {@link SymTypeExpression} symbol attributes. | ||
*/ | ||
public class SymTypeExpressionSerStrategy extends BITSerStrategy { | ||
public SymTypeExpressionSerStrategy() { | ||
super(SymTypeExpression.class.getName(), "null"); | ||
} | ||
|
||
@Override | ||
public HookPoint getSerialHook(String attrParam) { | ||
return new StringHookPoint(String.format("de.monticore.types.check.SymTypeExpressionDeSer.serializeMember(s2j.getJsonPrinter(), \"%s\", %s);", attrParam, attrParam)); | ||
} | ||
|
||
@Override | ||
public HookPoint getOptSerialHook(String attrParam) { | ||
return new StringHookPoint(String.format("de.monticore.types.check.SymTypeExpressionDeSer.serializeMember(s2j.getJsonPrinter(), \"%s\", %s);", attrParam, attrParam)); | ||
} | ||
|
||
@Override | ||
public HookPoint getListSerialHook(String attrParam) { | ||
return new StringHookPoint(String.format("de.monticore.types.check.SymTypeExpressionDeSer.serializeMember(s2j.getJsonPrinter(), \"%s\", %s);", attrParam, attrParam)); | ||
} | ||
|
||
public HookPoint getDeserialHook(String jsonParam, String attrParam) { | ||
return new StringHookPoint(String.format("return de.monticore.types.check.SymTypeExpressionDeSer.deserializeMember(\"%s\", symbolJson, scope);", attrParam)); | ||
} | ||
|
||
public HookPoint getOptDeserialHook(String jsonParam, String attrParam) { | ||
return new StringHookPoint(String.format("return de.monticore.types.check.SymTypeExpressionDeSer.deserializeOptionalMember(\"%s\", symbolJson, scope);", attrParam)); | ||
} | ||
|
||
public HookPoint getListDeserialHook(String jsonParam, String attrParam) { | ||
return new StringHookPoint(String.format("return de.monticore.types.check.SymTypeExpressionDeSer.deserializeListMember(\"%s\", symbolJson, scope);", attrParam)); | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
...e-grammar/src/main/java/de/monticore/symbols/oosymbols/_symboltable/FieldSymbolDeSer.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
...-grammar/src/main/java/de/monticore/symbols/oosymbols/_symboltable/MethodSymbolDeSer.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...-grammar/src/main/java/de/monticore/symbols/oosymbols/_symboltable/OOTypeSymbolDeSer.java
This file was deleted.
Oops, something went wrong.