Package de.japkit.test.members
Class MembersTemplate
java.lang.Object
de.japkit.test.members.MembersTemplate
@Clazz(commentExpr="The generated class for the example.")
@RuntimeMetadata
public class MembersTemplate
extends java.lang.Object
Within Templates annotated with
Clazz
, InnerClass
or
Template
, fields, methods, constructors and inner classes can be
generated. Clazz
represents a top level class, InnerClass
is
an inner class within a top level class or another inner class.
Template
is a reusable group of members.
Here, some basic examples are shown on how to generate members and how to use
Template
.
- For details on generating fields, see
FieldTemplate
. - For details on generating methods, see
MethodTemplate
. - For details on generating constructors, see
ConstructorTemplate
. - For details on generating inner classes, see
InnerClassTemplate
.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MembersTemplate.FieldWithMethod
Members can be grouped together inTemplate
s.class
MembersTemplate.SomeInnerClass
An inner class template. -
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
fixedField
A field within the generated top level class.(package private) ToStringTemplate
generateToString
Templates can also be made reusable by putting them into separate classes. -
Constructor Summary
Constructors Constructor Description MembersTemplate(java.lang.String param1, int param2)
A constructor in the top level class.It is generated by "copying" the constructor template and adjusting the name. -
Method Summary
Modifier and Type Method Description void
fixedMethod(java.lang.String param)
A method within the generated top level class.
-
Field Details
-
fixedField
java.lang.String fixedFieldA field within the generated top level class. It is generated by "copying" the field template. -
generateToString
Templates can also be made reusable by putting them into separate classes. Here, theToStringTemplate
is applied to add a toString method to the generated class.The type of the field is the template to be called. The name of the field is not relevant here.
-
-
Constructor Details
-
MembersTemplate
public MembersTemplate(java.lang.String param1, int param2)A constructor in the top level class.It is generated by "copying" the constructor template and adjusting the name.
-
-
Method Details
-
fixedMethod
public void fixedMethod(java.lang.String param)A method within the generated top level class. It is generated by "copying" the method template.
-