java.lang.Object | |
↳ | sun.reflect.annotation.AnnotationParser |
Parser for Java programming language annotations. Translates annotation byte streams emitted by compiler into annotation objects.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an annotation of the given type backed by the given
member -> value map.
| |||||||||||
Parses the annotations described by the specified byte array.
| |||||||||||
Parses the annotation member value at the current position in the
specified byte buffer, resolving constant references in the specified
constant pool.
| |||||||||||
Parses the parameter annotations described by the specified byte array.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns an annotation of the given type backed by the given member -> value map.
Parses the annotations described by the specified byte array. resolving constant references in the specified constant pool. The array must contain an array of annotations as described in the RuntimeVisibleAnnotations_attribute: u2 num_annotations; annotation annotations[num_annotations];
AnnotationFormatError | if an annotation is found to be malformed. |
---|
Parses the annotation member value at the current position in the specified byte buffer, resolving constant references in the specified constant pool. The cursor of the byte buffer must point to a "member_value structure" as described in the RuntimeVisibleAnnotations_attribute: member_value { u1 tag; union { u2 const_value_index; { u2 type_name_index; u2 const_name_index; } enum_const_value; u2 class_info_index; annotation annotation_value; { u2 num_values; member_value values[num_values]; } array_value; } value; } The member must be of the indicated type. If it is not, this method returns an AnnotationTypeMismatchExceptionProxy.
Parses the parameter annotations described by the specified byte array. resolving constant references in the specified constant pool. The array must contain an array of annotations as described in the RuntimeVisibleParameterAnnotations_attribute: u1 num_parameters; { u2 num_annotations; annotation annotations[num_annotations]; } parameter_annotations[num_parameters]; Unlike parseAnnotations, rawAnnotations must not be null! A null value must be handled by the caller. This is so because we cannot determine the number of parameters if rawAnnotations is null. Also, the caller should check that the number of parameters indicated by the return value of this method matches the actual number of method parameters. A mismatch indicates that an AnnotationFormatError should be thrown.
AnnotationFormatError | if an annotation is found to be malformed. |
---|