getDeclaration abstract method

Declaration getDeclaration()

Gets the type declaration metadata for this class.

Returns:

  • Complete type metadata including:
    • Annotations
    • Modifiers
    • Source location
    • Documentation comments

Example:

final declaration = Class.forType<MyClass>().getDeclaration();
print(declaration.annotations.length);
print(declaration.sourceFile);

Typical metadata includes:

  • IsAbstract
  • IsFinal
  • IsSealed
  • Source file location
  • Documentation comments
  • All annotations

Implementation

Declaration getDeclaration();