|
||||||||||
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. The value
parameter must be set even if a
container type is a SET type because Distinguished Encoding Rules (DER)
requires that elements in a SET type shall be encoded in defined order.
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
Required Element Summary | |
---|---|
int |
value
Indicates defined order of this element. |
Optional Element Summary | |
---|---|
boolean |
hasDefault
Indicates that the element has default value or not. |
boolean |
optional
Indicates that the element is optional or not. |
Element Detail |
---|
public abstract int value
public abstract boolean optional
true
if the element is optional.public abstract boolean hasDefault
true
if the element has default value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |