|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Retention(value=SOURCE) @Target(value=TYPE) public @interface Model
Defines a model class named className() which contains
properties defined via properties(). This class can have methods
annotated by ComputedProperty which define derived
properties in the model class.
The generated class's toString
converts the state of the object into
JSON format.
An example where one defines class Person with three
properties (firstName, lastName and
fullName) follows:
@Model(className="Person", properties={@Property(name = "firstName", type=String.class),@Property(name = "lastName", type=String.class) }) static class PersonImpl {@ComputedPropertystatic String fullName(String firstName, String lastName) { return firstName + " " + lastName; } }
| Required Element Summary | |
|---|---|
String |
className
Name of the model class |
Property[] |
properties
List of properties in the model. |
| Element Detail |
|---|
public abstract String className
public abstract Property[] properties
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||