Class ModifiersExampleGen
java.lang.Object
de.japkit.test.members.common.modifiers.ModifiersExampleGen
@ModifiersTrigger(shadow=true) @Generated(src="de.japkit.test.members.common.modifiers.ModifiersExample") public class ModifiersExampleGen extends java.lang.Object
The generated class for the example.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ModifiersExampleGen.AbstractInnerClass
To keep the abstract modifier for a generated class or inner class, keepAbstract must be set to true.class
ModifiersExampleGen.NonAbstractInnerClass
To support method templates without a dummy method body, also the class template containing them needs to be abstract. -
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
dynamicallyNonPublicStaticField
The expressions for setting modifiers dynamically have precedence over the according modifiers from the template.private java.lang.String
dynamicallyPrivateField
Visibilities can also be set dynamically.(package private) java.lang.String
finalField
For final fields, code for initialization needs to be provided.private java.lang.String
privateField
ModifiersTrigger are copied to the generated element.java.lang.String
publicField
ModifiersTrigger are copied to the generated element.static int
publicStaticField
ModifiersTrigger are copied to the generated element.(package private) int
transientVolatileField
ModifiersTrigger are copied to the generated element. -
Constructor Summary
Constructors Constructor Description ModifiersExampleGen()
-
Method Summary
Modifier and Type Method Description java.lang.String
notAbstractMethod()
The abstract modifier is removed from methods, if they have rules for generating a code body.
-
Field Details
-
publicField
public java.lang.String publicFieldModifiersTrigger are copied to the generated element.Here: public
-
privateField
private java.lang.String privateFieldModifiersTrigger are copied to the generated element.Here: private
-
publicStaticField
public static int publicStaticFieldModifiersTrigger are copied to the generated element.Here: public static
-
transientVolatileField
transient volatile int transientVolatileFieldModifiersTrigger are copied to the generated element.Here: transient volatile
-
finalField
final java.lang.String finalFieldFor final fields, code for initialization needs to be provided.Here, the String literal "initialValue" is generated.
- See Also:
- Constant Field Values
-
dynamicallyPrivateField
private java.lang.String dynamicallyPrivateFieldVisibilities can also be set dynamically.Here, the generate field is made private based on a boolean expression.
-
dynamicallyNonPublicStaticField
static java.lang.String dynamicallyNonPublicStaticFieldThe expressions for setting modifiers dynamically have precedence over the according modifiers from the template.Here, the generated field is not public, since publicCond evaluates to false. The field is still static, like given by the template.
-
-
Constructor Details
-
ModifiersExampleGen
public ModifiersExampleGen()
-
-
Method Details
-
notAbstractMethod
public java.lang.String notAbstractMethod()The abstract modifier is removed from methods, if they have rules for generating a code body. This allows to write method templates without a dummy method body.Here, the generated method is not abstract, since bodyCode is set.
-