addElement method

dynamic addElement(
  1. ExtractedInfoModel element
)

This function is responsible to get the specific element that we need to process and pull it from everywhere in the codebase to here to add and keep in the lists

Implementation

addElement(ExtractedInfoModel element) {
  switch (element.type) {
    case AnnotationTypes.page:
      pagesList.add(element);
      break;
    case AnnotationTypes.controller:
      controllersList.add(element);
      break;
    case AnnotationTypes.component:
      componentsList.add(element);
      break;
    case AnnotationTypes.repository:
      repositoriesList.add(element);
      break;
    default:
      break;
  }
  importsList.add(element.source.correctImport);
}