All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.maxxton.microdocs.crawler.Crawler Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package com.maxxton.microdocs.crawler;

import com.maxxton.microdocs.core.builder.ProjectBuilder;
import com.maxxton.microdocs.core.domain.Project;
import com.maxxton.microdocs.core.reflect.ReflectClass;

import java.util.List;

/**
 * Crawls classes and extract the project information
 * @author Steven Hermans
 */
public abstract class Crawler {

    /**
     * Extract project information from the classes
     * @param classes list of ReflectClasses
     * @return extracted project
     */
    public Project crawl(List> classes){
        //start builder
        ProjectBuilder projectBuilder = new ProjectBuilder();
        classes.forEach(clazz -> projectBuilder.projectClass(clazz.getName()));

        //extract project information
        return extractProject(projectBuilder, classes);
    }

    /**
     * Handles the extraction of the project information
     * @param projectBuilder builder of the project
     * @param classes list of ReflectClasses
     * @return extracted project
     */
    protected abstract Project extractProject(ProjectBuilder projectBuilder, List> classes);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy