visitClassElement method

  1. @override
void visitClassElement(
  1. ClassElement element
)
override

Visits a class element and extracts its documentation.

Implementation

@override
void visitClassElement(ClassElement element) {
  final superTypeInfo = _getSuperTypeInfo(element);

  components.add(
    DocComponent(
      name: element.name!,
      filePath: filePath,
      entryPoint: entryPoint,
      description: _getDescription(element),
      constructors: _mapConstructors(element.constructors),
      properties: _mapProperties(_collectFieldsWithInheritance(element)),
      methods: _mapMethods(_collectMethodsWithInheritance(element)),
      type: DocComponentType.classType,
      annotations: _getAnnotations(element),
      superClasses: superTypeInfo.superClasses,
      superClassPackages: superTypeInfo.superClassPackages,
      interfaces: element.interfaces.map((e) => e.element.name!).toList(),
      mixins: element.mixins.map((e) => e.element.name!).toList(),
      typeParameters: _getTypeParameters(element.typeParameters),
    ),
  );
  super.visitClassElement(element);
}