Skip to main content

Module annotations

Module annotations 

Source
Expand description

Annotation attribute parser for JVM bytecode.

Converts cafebabe’s parsed annotation structures into the sqry stub model types (AnnotationStub, AnnotationElement, AnnotationElementValue).

This module handles the four annotation attribute types defined in JVMS 4.7.16-4.7.19:

  • RuntimeVisibleAnnotations (is_runtime_visible = true)
  • RuntimeInvisibleAnnotations (is_runtime_visible = false)
  • RuntimeVisibleParameterAnnotations (is_runtime_visible = true)
  • RuntimeInvisibleParameterAnnotations (is_runtime_visible = false)

§Type Descriptor Conversion

Annotation type descriptors in JVM bytecode use the internal form (e.g., Lorg/springframework/web/bind/annotation/RequestMapping;). These are converted to FQN dot-notation (e.g., org.springframework.web.bind.annotation.RequestMapping).

Functions§

convert_annotations
Convert a list of cafebabe Annotation values into AnnotationStub records.
convert_parameter_annotations
Convert a list of cafebabe ParameterAnnotation values into nested Vec<Vec<AnnotationStub>> records.
extract_annotations_from_attribute
Extract all annotations from a cafebabe AttributeData value.
extract_parameter_annotations_from_attribute
Extract parameter annotations from a cafebabe AttributeData value.