Package org.tentackle.wurblet
Class DTO
- java.lang.Object
-
- org.wurbelizer.wurblet.AbstractWurblet
-
- org.wurbelizer.wurblet.AbstractJavaWurblet
-
- org.tentackle.wurblet.DTOWurblet
-
- org.tentackle.wurblet.DTO
-
- All Implemented Interfaces:
org.wurbelizer.wurblet.Wurblet
public class DTO extends DTOWurblet
(@wurblet) DTO creates code for a data transfer object.usage:
@wurblet <tag> DTO [--builder] <filename>arguments:
- --builder: option to generate code according to the builder pattern.
- filename: the file holding the DTO model.
AbstractWurblet.The model is usually stored in a heap-file such as ".$filename" created as a here-document within the leading comment block of the DTO-file.
Each line describes a property.
Example:String name the object's name int count the counter
If the line is prefixed with "^", the property is passed to the super entity within the constructor.
In builder pattern mode, standard java inheritance must be used instead.
Example:^String name the name
If the line is prefixed with "=", the property is mutable and a setter is generated.
In builder pattern mode, no builder method is generated for this property.
Example:=String name the name
Only for builder mode: lines prefixed with "!" are considered as required and a TentackleRuntimeException is thrown by the build-method, if a required attribute was not configured. Notice that a required attribute is always immutable.!String name the name
The comment may contain optional annotations enclosed in square brackets.String name the name [@Bindable(MAXCOL=20)] [@MyAnno]
Annotations not belonging to a property are applied to all properties, if not already defined in the comment.
[@Bindable] String blah the blah ...
If the builder pattern is used and the class extends a superclass, the builder is created as an extension of the superclass'es builder.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.tentackle.wurblet.DTOWurblet
DTOWurblet.Property
-
-
Field Summary
-
Fields inherited from class org.tentackle.wurblet.DTOWurblet
annotations, extendsWithBuilder, filename, needConstructor, properties, withBuilder
-
-
Constructor Summary
Constructors Constructor Description DTO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()-
Methods inherited from class org.wurbelizer.wurblet.AbstractJavaWurblet
getClassName, getPackageName, getSuperClassName, isAbstract, isFinal, isPrivate, isProtected, isPublic, toString
-
-
-
-
Method Detail
-
run
public void run() throws org.wurbelizer.wurbel.WurbelException- Specified by:
runin interfaceorg.wurbelizer.wurblet.Wurblet- Overrides:
runin classDTOWurblet- Throws:
org.wurbelizer.wurbel.WurbelException
-
-