|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Target(value={METHOD,TYPE,FIELD})
@Documented
@Retention(value=RUNTIME)
public @interface Field
Defines a header field's getter method. Any method annotated with
Field annotation will be included in JFormatter
output. The field annotation allows a number of constant properties about the
field to be declared. By default, the method's name becomes the field name as
well.
The Field annotation provides a way to set any of the field's
properties statically. The value set using this annotation will be set
permanently as a constant for that property. If the property is ommited, its
default value will be used or if a instance method is defined that is marked
with Dynamic annotation, then than method will be used at
runtime to obtain the value for the property it generating values for. For
example, the display field property which is used as text to
display whenever a textual name for the field is needed, can be set
statically using this annotation:
@Field(display = "more descriptive name of the field")
public int fieldA() {
return 0;
}
or the same property can be generated dynamically at runtime by ommiting the
the annotation parameter "display" in this annotation and supplying a
separate instance method which generates the value:
@Dynamic(Property.DISPLAY)
public String fieldADisplay() {
return (fieldA() == 0) ? "FIELD_A" : "fieldA";
}
Both Field.display and the runtime method can not be set at the same time.
Again by default the name of the field is used as display of the field's
name.
| Optional Element Summary | |
|---|---|
java.lang.String |
description
A short description of the field's value. |
java.lang.String |
display
Name of the field that will be displayed. |
java.lang.String |
format
A formatting string for the value of the field. |
int |
length
Static length of this field within the header in bits. |
long |
mask
Sets which bits within the field are significant. |
java.lang.String |
name
Name of the field. |
java.lang.String |
nicname
A short name of the field to display. |
int |
offset
Static offset of this field into the header in bits. |
java.lang.String |
parent
Sets the parent field's name and implicitely declares this field to be a subfield of the parent. |
JFormatter.Priority |
priority
A priority this field is assigned which is used in determining which field to include in output depending on what JFormat.Detail level the user has selected. |
java.lang.String |
units
Units associated with the value of the field. |
public abstract int offset
@Dynamic(Property.OFFSET) annotation.
public abstract int length
@Dynamic(Property.LENGTH) annotation.
public abstract java.lang.String name
public abstract java.lang.String display
public abstract java.lang.String nicname
public abstract java.lang.String format
public abstract java.lang.String units
public abstract java.lang.String description
public abstract java.lang.String parent
public abstract long mask
public abstract JFormatter.Priority priority
Priority.MEDIUM.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||