StandardEntityDeclaration class final

Concrete implementation of EntityDeclaration providing standard reflection metadata.

Represents a declared entity (class, function, variable, etc.) with:

  • Optional analyzer elements
  • Optional Dart type information
  • Runtime type information
  • Debug identifiers

{@template standard_entity_declaration_features}

Key Features

  • Bridges analyzer and runtime reflection
  • Lightweight immutable value object
  • Debug-friendly representations
  • JSON serialization support

Typical Usage

Used by code generators and runtime systems to represent declared program elements in reflection contexts.

Example Creation

final declaration = StandardEntityDeclaration(
  element: someElement,      // Optional analyzer Element
  dartType: someDartType,    // Optional analyzer DartType
  type: MyClass,            // Required runtime Type
  debugger: 'my_class_decl' // Optional debug identifier
);

{@endtemplate}

Inheritance
Implemented types
Implementers

Constructors

StandardEntityDeclaration({Element? element, DartType? dartType, required Type type, required bool isPublic, required bool isSynthetic, required String name, String? debugger})
Creates a standard entity declaration
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
getDartType() → DartType?
The analyzer DartType of the entity for enhanced type operations.
override
getDebugIdentifier() String
The debug identifier for the entity.
override
getElement() → Element?
The analyzer element associated with this declaration.
override
getIsPublic() bool
Checks if this declaration is a public declaration.
inherited
getIsSynthetic() bool
Checks if a declaration is a synthetic declaration.
inherited
getName() String
Gets the name of the declared element.
inherited
getType() Type
Gets the runtime type of the declared element.
inherited
hasAnalyzerSupport() bool
Returns true if this declaration has analyzer information available.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object>
Returns a JSON representation of this entity.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited