Package eu.bandm.tools.umod
Class UMod2java.CompileConstructors
java.lang.Object
eu.bandm.tools.umod.UMod2java.CompileConstructors
- Enclosing class:
- UMod2java
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<UMod.ClassDef,
Set<String>> protected final List<UMod.FieldDef>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkDuplicateConstructor
(UMod.ClassDef cd, String signature) protected void
expandOrInherit
(UMod.ClassDef cd, Integer key, SortedMap<Integer, UMod.FieldDef> superfields) protected boolean
makeconstructor
(UMod.ClassDef cd, Integer key, Collection<UMod.FieldDef> inherited, Collection<UMod.FieldDef> newparams) Generates a constructor with signature "inherited+newparams".
Compiles a call to "super()" for the former and assignment statements for the latter().
ASSUME "Collection" is ordered, since it is "aTreeMap.values()"protected void
process
(UMod.ClassDef cd) protected void
process
(UMod.Forest model) protected boolean
Returns true immediately if a 0ary constructor is defined by the user explictly (in verbatim Java code), or already implicitly generated by this routine.Otherwise: if there are no obligate fields without initial value, a new 0ary constructor is generated, and "true" returned. Otherwise returns false.
-
Field Details
-
EMPTYLIST
-
constructorSignatures
-
-
Constructor Details
-
CompileConstructors
protected CompileConstructors()
-
-
Method Details
-
test_0ary_constructor
Returns true immediately if a 0ary constructor is defined by the user explictly (in verbatim Java code), or already implicitly generated by this routine.Otherwise: if there are no obligate fields without initial value, a new 0ary constructor is generated, and "true" returned. Otherwise returns false. -
process
-
process
-
expandOrInherit
protected void expandOrInherit(UMod.ClassDef cd, Integer key, SortedMap<Integer, UMod.FieldDef> superfields) -
checkDuplicateConstructor
-
makeconstructor
protected boolean makeconstructor(UMod.ClassDef cd, Integer key, Collection<UMod.FieldDef> inherited, Collection<UMod.FieldDef> newparams) Generates a constructor with signature "inherited+newparams".
Compiles a call to "super()" for the former and assignment statements for the latter().
ASSUME "Collection" is ordered, since it is "aTreeMap.values()"
-