RPNXCortado
C++23 JVM class-file, bytecode, validation, and JAR toolkit
Loading...
Searching...
No Matches
attributes.hpp File Reference

Typed JVM attributes and the complete owning class-file model. More...

#include <cstddef>
#include <cstdint>
#include <rpnx/cortado/bytecode.hpp>
#include <rpnx/cortado/types.hpp>
#include <rpnx/variant.hpp>
#include <utility>
#include <variant>
#include <vector>

Go to the source code of this file.

Classes

struct  rpnx::cortado::unknown_attribute
 An unknown standard-extension or vendor attribute retained verbatim. More...
 
struct  rpnx::cortado::constant_value_attribute
 A ConstantValue attribute. More...
 
struct  rpnx::cortado::top_variable_info
 A top verification type. More...
 
struct  rpnx::cortado::integer_variable_info
 An integer verification type. More...
 
struct  rpnx::cortado::float_variable_info
 A float verification type. More...
 
struct  rpnx::cortado::double_variable_info
 A double verification type. More...
 
struct  rpnx::cortado::long_variable_info
 A long verification type. More...
 
struct  rpnx::cortado::null_variable_info
 A null verification type. More...
 
struct  rpnx::cortado::uninitialized_this_variable_info
 An uninitialized-this verification type. More...
 
struct  rpnx::cortado::object_variable_info
 An object or array verification type. More...
 
struct  rpnx::cortado::uninitialized_variable_info
 An uninitialized value created by a new instruction. More...
 
struct  rpnx::cortado::same_frame
 A same_frame entry retaining its exact compact frame type. More...
 
struct  rpnx::cortado::same_locals_one_stack_item_frame
 A same_locals_1_stack_item_frame entry. More...
 
struct  rpnx::cortado::same_locals_one_stack_item_frame_extended
 A same_locals_1_stack_item_frame_extended entry. More...
 
struct  rpnx::cortado::chop_frame
 A chop_frame entry retaining its exact frame type. More...
 
struct  rpnx::cortado::same_frame_extended
 A same_frame_extended entry. More...
 
struct  rpnx::cortado::append_frame
 An append_frame entry retaining its exact frame type. More...
 
struct  rpnx::cortado::full_frame
 A full_frame entry. More...
 
struct  rpnx::cortado::stack_map_table_attribute
 A StackMapTable attribute. More...
 
struct  rpnx::cortado::exceptions_attribute
 An Exceptions attribute. More...
 
struct  rpnx::cortado::inner_class_info
 One InnerClasses attribute entry. More...
 
struct  rpnx::cortado::inner_classes_attribute
 An InnerClasses attribute. More...
 
struct  rpnx::cortado::enclosing_method_attribute
 An EnclosingMethod attribute. More...
 
struct  rpnx::cortado::synthetic_attribute
 A Synthetic marker attribute. More...
 
struct  rpnx::cortado::signature_attribute
 A Signature attribute. More...
 
struct  rpnx::cortado::source_file_attribute
 A SourceFile attribute. More...
 
struct  rpnx::cortado::source_debug_extension_attribute
 A SourceDebugExtension attribute whose bytes are not modified UTF-8. More...
 
struct  rpnx::cortado::line_number_info
 One LineNumberTable entry. More...
 
struct  rpnx::cortado::line_number_table_attribute
 A LineNumberTable attribute. More...
 
struct  rpnx::cortado::local_variable_info
 One LocalVariableTable entry. More...
 
struct  rpnx::cortado::local_variable_table_attribute
 A LocalVariableTable attribute. More...
 
struct  rpnx::cortado::local_variable_type_info
 One LocalVariableTypeTable entry. More...
 
struct  rpnx::cortado::local_variable_type_table_attribute
 A LocalVariableTypeTable attribute. More...
 
struct  rpnx::cortado::deprecated_attribute
 A Deprecated marker attribute. More...
 
struct  rpnx::cortado::annotation_constant_value< Kind >
 A constant-valued annotation element. More...
 
struct  rpnx::cortado::annotation_enum_value
 An enum-valued annotation element. More...
 
struct  rpnx::cortado::annotation_class_value
 A class-valued annotation element. More...
 
struct  rpnx::cortado::annotation_value
 Any annotation element_value structure. More...
 
struct  rpnx::cortado::annotation_element
 One named annotation element. More...
 
struct  rpnx::cortado::annotation
 A JVM annotation structure. More...
 
struct  rpnx::cortado::annotation_array_value
 An array-valued annotation element. More...
 
struct  rpnx::cortado::runtime_visible_annotations_attribute
 A RuntimeVisibleAnnotations attribute. More...
 
struct  rpnx::cortado::runtime_invisible_annotations_attribute
 A RuntimeInvisibleAnnotations attribute. More...
 
struct  rpnx::cortado::runtime_visible_parameter_annotations_attribute
 A RuntimeVisibleParameterAnnotations attribute. More...
 
struct  rpnx::cortado::runtime_invisible_parameter_annotations_attribute
 A RuntimeInvisibleParameterAnnotations attribute. More...
 
struct  rpnx::cortado::type_parameter_target_info
 A type-parameter annotation target. More...
 
struct  rpnx::cortado::supertype_target_info
 A supertype annotation target. More...
 
struct  rpnx::cortado::type_parameter_bound_target_info
 A type-parameter-bound annotation target. More...
 
struct  rpnx::cortado::empty_target_info
 An empty annotation target. More...
 
struct  rpnx::cortado::formal_parameter_target_info
 A formal-parameter annotation target. More...
 
struct  rpnx::cortado::throws_target_info
 A throws annotation target. More...
 
struct  rpnx::cortado::local_variable_target_range
 One local-variable annotation range. More...
 
struct  rpnx::cortado::local_variable_target_info
 A local-variable annotation target. More...
 
struct  rpnx::cortado::catch_target_info
 An exception-parameter annotation target. More...
 
struct  rpnx::cortado::offset_target_info
 A bytecode-offset annotation target. More...
 
struct  rpnx::cortado::type_argument_target_info
 A bytecode-offset and type-argument annotation target. More...
 
struct  rpnx::cortado::type_annotation_target< Type, Info >
 A target_info paired with its compile-time target_type discriminator. More...
 
struct  rpnx::cortado::type_path_entry
 One type_path component. More...
 
struct  rpnx::cortado::type_annotation
 A JVM type_annotation structure. More...
 
struct  rpnx::cortado::runtime_visible_type_annotations_attribute
 A RuntimeVisibleTypeAnnotations attribute. More...
 
struct  rpnx::cortado::runtime_invisible_type_annotations_attribute
 A RuntimeInvisibleTypeAnnotations attribute. More...
 
struct  rpnx::cortado::annotation_default_attribute
 An AnnotationDefault attribute. More...
 
struct  rpnx::cortado::bootstrap_method
 One BootstrapMethods attribute entry. More...
 
struct  rpnx::cortado::bootstrap_methods_attribute
 A BootstrapMethods attribute. More...
 
struct  rpnx::cortado::method_parameter
 One MethodParameters entry. More...
 
struct  rpnx::cortado::method_parameters_attribute
 A MethodParameters attribute. More...
 
struct  rpnx::cortado::module_requires_info
 One requires entry in a Module attribute. More...
 
struct  rpnx::cortado::module_exports_info
 One exports entry in a Module attribute. More...
 
struct  rpnx::cortado::module_opens_info
 One opens entry in a Module attribute. More...
 
struct  rpnx::cortado::module_provides_info
 One provides entry in a Module attribute. More...
 
struct  rpnx::cortado::module_attribute
 A Module attribute. More...
 
struct  rpnx::cortado::module_packages_attribute
 A ModulePackages attribute. More...
 
struct  rpnx::cortado::module_main_class_attribute
 A ModuleMainClass attribute. More...
 
struct  rpnx::cortado::nest_host_attribute
 A NestHost attribute. More...
 
struct  rpnx::cortado::nest_members_attribute
 A NestMembers attribute. More...
 
struct  rpnx::cortado::permitted_subclasses_attribute
 A PermittedSubclasses attribute. More...
 
struct  rpnx::cortado::record_component_info
 One component in a Record attribute. More...
 
struct  rpnx::cortado::record_attribute
 A Record attribute. More...
 
struct  rpnx::cortado::exception_handler
 One Code exception-table entry. More...
 
struct  rpnx::cortado::code_attribute
 A fully typed Code attribute. More...
 
struct  rpnx::cortado::field_info
 A JVM field_info structure. More...
 
struct  rpnx::cortado::method_info
 A JVM method_info structure. More...
 
struct  rpnx::cortado::class_file
 An owning, typed representation of one JVM class file. More...
 

Namespaces

namespace  rpnx::cortado
 JVM class-file, bytecode, validation, generation, and JAR APIs.
 

Typedefs

using rpnx::cortado::verification_type_info = std::variant< top_variable_info, integer_variable_info, float_variable_info, double_variable_info, long_variable_info, null_variable_info, uninitialized_this_variable_info, object_variable_info, uninitialized_variable_info >
 A StackMapTable verification_type_info structure.
 
using rpnx::cortado::stack_map_frame = std::variant< same_frame, same_locals_one_stack_item_frame, same_locals_one_stack_item_frame_extended, chop_frame, same_frame_extended, append_frame, full_frame >
 Any valid StackMapTable frame encoding.
 
using rpnx::cortado::type_annotation_target_info = std::variant< type_annotation_target< type_annotation_target_type::class_type_parameter, type_parameter_target_info >, type_annotation_target< type_annotation_target_type::method_type_parameter, type_parameter_target_info >, type_annotation_target< type_annotation_target_type::class_extends, supertype_target_info >, type_annotation_target< type_annotation_target_type::class_type_parameter_bound, type_parameter_bound_target_info >, type_annotation_target< type_annotation_target_type::method_type_parameter_bound, type_parameter_bound_target_info >, type_annotation_target< type_annotation_target_type::field, empty_target_info >, type_annotation_target< type_annotation_target_type::method_return, empty_target_info >, type_annotation_target< type_annotation_target_type::method_receiver, empty_target_info >, type_annotation_target< type_annotation_target_type::method_formal_parameter, formal_parameter_target_info >, type_annotation_target< type_annotation_target_type::throws_, throws_target_info >, type_annotation_target< type_annotation_target_type::local_variable, local_variable_target_info >, type_annotation_target< type_annotation_target_type::resource_variable, local_variable_target_info >, type_annotation_target< type_annotation_target_type::exception_parameter, catch_target_info >, type_annotation_target< type_annotation_target_type::instanceof_, offset_target_info >, type_annotation_target< type_annotation_target_type::new_, offset_target_info >, type_annotation_target< type_annotation_target_type::constructor_reference, offset_target_info >, type_annotation_target< type_annotation_target_type::method_reference, offset_target_info >, type_annotation_target< type_annotation_target_type::cast, type_argument_target_info >, type_annotation_target< type_annotation_target_type::constructor_invocation_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::method_invocation_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::constructor_reference_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::method_reference_type_argument, type_argument_target_info > >
 Any valid type-annotation target_info structure.
 
using rpnx::cortado::record_component_attribute = std::variant< signature_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute >
 Attributes valid in a record_component_info structure.
 
using rpnx::cortado::code_nested_attribute = std::variant< stack_map_table_attribute, line_number_table_attribute, local_variable_table_attribute, local_variable_type_table_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute >
 Attributes valid within a Code attribute.
 
using rpnx::cortado::field_attribute = std::variant< constant_value_attribute, synthetic_attribute, signature_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute >
 Attributes valid on a field_info structure.
 
using rpnx::cortado::method_attribute = std::variant< code_attribute, exceptions_attribute, synthetic_attribute, signature_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_parameter_annotations_attribute, runtime_invisible_parameter_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, annotation_default_attribute, method_parameters_attribute, unknown_attribute >
 Attributes valid on a method_info structure.
 
using rpnx::cortado::class_attribute = std::variant< inner_classes_attribute, enclosing_method_attribute, synthetic_attribute, signature_attribute, source_file_attribute, source_debug_extension_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, bootstrap_methods_attribute, module_attribute, module_packages_attribute, module_main_class_attribute, nest_host_attribute, nest_members_attribute, record_attribute, permitted_subclasses_attribute, unknown_attribute >
 Attributes valid on a ClassFile structure.
 

Enumerations

enum class  rpnx::cortado::annotation_constant_kind : std::uint8_t {
  byte = 'B' , character = 'C' , double_precision = 'D' , floating_point = 'F' ,
  integer = 'I' , long_integer = 'J' , short_integer = 'S' , boolean = 'Z' ,
  string = 's'
}
 Constant-valued annotation element tags. More...
 
enum class  rpnx::cortado::type_annotation_target_type : std::uint8_t {
  class_type_parameter = 0x00 , method_type_parameter = 0x01 , class_extends = 0x10 , class_type_parameter_bound = 0x11 ,
  method_type_parameter_bound = 0x12 , field = 0x13 , method_return = 0x14 , method_receiver = 0x15 ,
  method_formal_parameter = 0x16 , throws_ = 0x17 , local_variable = 0x40 , resource_variable = 0x41 ,
  exception_parameter = 0x42 , instanceof_ = 0x43 , new_ = 0x44 , constructor_reference = 0x45 ,
  method_reference = 0x46 , cast = 0x47 , constructor_invocation_type_argument = 0x48 , method_invocation_type_argument = 0x49 ,
  constructor_reference_type_argument = 0x4A , method_reference_type_argument = 0x4B
}
 A type-annotation target discriminator. More...
 
enum class  rpnx::cortado::type_path_kind : std::uint8_t { array = 0 , nested = 1 , wildcard_bound = 2 , type_argument = 3 }
 A type_path component kind. More...
 
enum class  rpnx::cortado::method_parameter_access_flags : std::uint16_t { none = 0 , is_final = 0x0010 , is_synthetic = 0x1000 , is_mandated = 0x8000 }
 JVM MethodParameters access flags. More...
 
enum class  rpnx::cortado::module_access_flags : std::uint16_t { none = 0 , is_open = 0x0020 , is_synthetic = 0x1000 , is_mandated = 0x8000 }
 JVM module declaration flags. More...
 
enum class  rpnx::cortado::module_requires_flags : std::uint16_t {
  none = 0 , is_transitive = 0x0020 , is_static_phase = 0x0040 , is_synthetic = 0x1000 ,
  is_mandated = 0x8000
}
 JVM module requires flags. More...
 
enum class  rpnx::cortado::module_exports_opens_flags : std::uint16_t { none = 0 , is_synthetic = 0x1000 , is_mandated = 0x8000 }
 JVM module exports and opens flags. More...
 

Detailed Description

Typed JVM attributes and the complete owning class-file model.

Every standard attribute alternative appears only in the context variants where the JVM permits it. Unknown attributes retain their exact payload.

Unless a member says otherwise, every name_index refers to the CONSTANT_Utf8 entry containing the enclosing attribute's predefined name. Other members ending in _index preserve the exact logical constant-pool index and therefore require the constant kind specified by the JVM format.

Definition in file attributes.hpp.