Skip to content

Add Support for Java Annotations #360

@Shashankss1205

Description

@Shashankss1205
  • Description: Metadata added to code elements, used by the compiler or frameworks.
  • Graphing Strategy: Model with an ANNOTATES relationship from an :Annotation node to the code element it modifies.

Implementation Steps

This requires an :Annotation node type and an ANNOTATES relationship.

  1. Modify the Java Parser (.../languages/java.py)

    • Add queries to find both annotation definitions and their usage.
    • Create _find_annotations (for definitions) and _find_annotation_applications methods.
    • Return results under keys "annotations" and "annotation_applications".
  2. Update the Generic Graph Builder (.../tools/graph_builder.py)

    • Add the :Annotation node type following the standard procedure (schema and item_mappings).
    • Add a new section in add_file_to_graph to process annotation_applications and create the ANNOTATES relationships between the :Annotation node and the annotated element.

Metadata

Metadata

Labels

Hacktoberfest25This issue is created as a part of Hacktoberfest 2025 programgood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions