8#ifndef RPNX_CORTADO_VALIDATION_HPP
9#define RPNX_CORTADO_VALIDATION_HPP
20 enum class validation_code : std::uint16_t { invalid_version, invalid_constant_pool_index, invalid_constant_pool_reference_kind, feature_not_supported_by_version, invalid_flags, invalid_descriptor, invalid_attribute_name, duplicate_attribute, missing_code_attribute, unexpected_code_attribute, invalid_code, invalid_branch_target, invalid_switch_table, invalid_exception_range, invalid_stack_map, invalid_annotation, invalid_module_structure, resource_limit_exceeded };
23 enum class validation_location_kind : std::uint8_t {
class_file, constant_pool, interface, field, method,
class_attribute,
field_attribute,
method_attribute, code,
code_attribute, record_component };
62 [[nodiscard]]
bool valid() const noexcept;
Typed JVM attributes and the complete owning class-file model.
JVM class-file, bytecode, validation, generation, and JAR APIs.
validation_code
Stable machine-readable codes emitted by class-file validation.
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 > field_attribute
Attributes valid on a field_info structure.
validation_report validate_class_file(class_file const &value, validation_options const &options={})
Validates a complete class-file model without throwing for model errors.
validation_location_kind
The class-file area associated with a diagnostic.
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 > method_attribute
Attributes valid on a method_info structure.
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 > class_attribute
Attributes valid on a ClassFile structure.
An owning, typed representation of one JVM class file.
A fully typed Code attribute.
A byte offset within the code array of a Code attribute.
One class-file validation failure.
std::string message
Human-readable explanation; not intended as a stable programmatic identifier.
validation_location location
Structured position in the validated model.
validation_code code
Stable category suitable for programmatic handling.
A structured location within an owning class_file model.
std::size_t primary_index
Primary zero-based collection index for kind, or zero when unused.
validation_location_kind kind
Model area to which the remaining coordinates apply.
std::size_t secondary_index
Nested zero-based collection index, or zero when unused.
code_offset offset
Code-array byte offset for instruction diagnostics, or zero when unused.
Controls strict structural and version-aware validation.
std::size_t maximum_diagnostics
Maximum diagnostics retained before validation stops.
std::size_t maximum_nesting_depth
Maximum recursive annotation/signature structure depth.
std::size_t maximum_structure_nodes
Maximum aggregate model nodes visited.
bool validate_instruction_constant_types
Whether instruction operands must reference the opcode-required constant kinds.
The complete bounded diagnostic result of one validation pass.
bool valid() const noexcept
Returns true when validation produced no diagnostics.
std::vector< validation_diagnostic > diagnostics
Failures in deterministic traversal order, bounded by the options.