...
JEAF Generator makes us of the so called builder pattern for Service Objects and POJOs. In case that attributes in the UML model are marked to be readonly
, then these attributes can only be set using the builder but not directly using methods on the generated class itself.
...
Transient Modifier for
...
Attributes /
...
Roles
Using stereotype «Transient»
it is possible to add keyword transient to generated code.
Reduce visibility of Attributes / Roles
Using stereotype «Internal»
it is possible to change the visibility of generated access methods to package visibility.
Usage of Derived Properties
UML supports so called derived properties. This means that a property can be derived (calculated) from other properties of an object. JEAF Generator also supports derived properties. In the generated Java code this will lead to a getXYZ( )
operation that has to be implemented manually.
...
Usage of Java Collection Types
When modelling an association between classes then inside the UML model already its multiplicity will be defined. If the multiplicity is 0..*
or 1..*
then in the generated code some kind of Java Collection class is expected to be generated. As there are many types of Collection classes the table below will explain how the information from the model will be used the find the best matching Java Collection type.
Multiplicity | Is Ordered | Is Unique | Type |
---|---|---|---|
|
|
| Referenced Class from the UML model |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The screenshot below show shows an example of an 0..*
association where attributes for Java Collections are defined. According to the table above class java.util.Set
will be used in the generated code.
...
JEAF Generator supports the following validation annotations:
Stereotype | Description* | Applicable Types |
---|---|---|
| The annotated element must be false. |
|
| The annotated element must be true. |
|
| The annotated element must be a number whose value must be lower or equal to the specified maximum. Note that |
|
| The annotated element must be a number whose value must be higher or equal to the specified minimum. Note that |
|
| The annotated element must be a number within accepted range. |
|
| The string has to be a well-formed email address. Exact semantics of what makes up a valid email address are left to Jakarta Bean Validation providers. |
|
| The annotated element must be an instant, date or time in the future. | Java date types |
| The annotated element must be an instant, date or time in the present or in the future. | Java date types |
| The annotated element must be a number whose value must be lower or equal to the specified maximum. Note that |
|
| The annotated element must be a number whose value must be higher or equal to the specified minimum. Note that |
|
| The annotated element must be a strictly negative number (i.e. 0 is considered as an invalid value). |
|
| The annotated element must be a negative number or 0. |
|
| The annotated element must not be |
|
| The annotated element must not be |
|
| The annotated element must not be | any type |
| The annotated element must be | any tpye |
| The annotated element must be an instant, date or time in the past. | Java date types |
| The annotated element must be an instant, date or time in the past or in the present. | Java date types |
| The annotated The regular expression follows the Java regular expression conventions see |
|
| The annotated element must be a strictly positive number (i.e. 0 is considered as an invalid value). |
|
| The annotated element must be a positive number or 0. |
|
| The annotated element size must be between the specified boundaries (included). |
|
| Marks a property, method parameter or method return type for validation cascading. Constraints defined on the object and its properties are be validated when the property, method parameter or method return type is validated. This behavior is applied recursively. | Property, parameter or return type |
* Description is taken from OpenJDK
...