|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) public @interface Default
The Default
annotation is used to specify that all
fields or methods should be serialized in a default manner. This
basically allows an objects fields or properties to be serialized
without the need to annotate them. This has advantages if the
format of the serialized object is not important, as it allows
the object to be serialized with a minimal use of annotations.
@Root @Default(DefaultType.FIELD) public class Example { ... }Defaults can be applied to either fields or property methods. If this annotation is applied to a class, certain fields or methods can be ignored using the
Transient
annotation. If a
member is marked as transient then it will not be serialized. The
defaults are applied only to those members that are not otherwise
annotated with an XML annotation.
Transient
Optional Element Summary | |
---|---|
boolean |
required
This is used to determine if the generated annotations are required or not. |
DefaultType |
value
This method is used to return the type of default that is to be applied to the class. |
public abstract DefaultType value
public abstract boolean required
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |