|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value=FIELD) @Retention(value=RUNTIME) public @interface ASN1Element
Indicates that a field is an element of a structured type.
If an @ASN1Element annotation is present on a field, the field is
treated as a component of a SEQUENCE type or a SET type. A field annotated as
@ASN1Element must be declared as public non-final
non-static, and the type shall be a sub-class of ASN1Type.
The value parameter represents an order of appearance of a field in
an ASN.1 type definition. If automatic tagging is used, the value
parameter must be set even if a container type is a SET type.
Otherwise, the value parameter for element of SET type can be
omitted.
For example, following ASN.1 definition :
Sample ::= SET {
number INTEGER,
bool BOOLEAN OPTIONAL }
can be translated as :
public class Sample extends SET {
@ASN1ElementType(0)
public INTEGER number;
@ASN1ElementType(value = 1, optional = true)
public BOOLEAN bool;
}
ConstructiveType| Optional Element Summary | |
|---|---|
boolean |
hasDefault
Indicates that the element has default value or not. |
boolean |
optional
Indicates that the element is optional or not. |
int |
value
Indicates defined order of this element. |
public abstract int value
public abstract boolean optional
optional is false.
true if the element is optional.public abstract boolean hasDefault
hasDefault is false.
true if the element has default value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||