Chapter 2. OpenEngSB Maven Plugin for Contributor

While the previous chapter gave a detailed description of the maven plugin this one focues on the internals of the plugin and tries to explain the internal structure, helping ppl who want to understand the internals and extend it.

2.1. Exract Sources for Documentation

Sources for documentation are extracted using the org.openengsb.openengsbplugin.ExtractDocSourceMojo. The mojo itself includes a list of implementations of the org.openengsb.openengsbplugin.extract.AnnotatedSourceExtractor interface.

/**
 * Base interface which needs to be implemented to add an additional source type to analyse.
 */
public interface AnnotatedSourceExtractor {

    /**
     * Checks if the extractor can handle a specific file type.
     */
    boolean canExtractFile(File file);

    /**
     * Checks if the line is a start line for the extractor.
     */
    boolean isStartLine(String line);

    /**
     * Checks if the specific line is a stop line for the extractor.
     */
    boolean isStopLine(String line);

    /**
     * Since the lines could be structured quite specific the extrator need to extract the target filename from the line
     * name.
     */
    public String extractTargetFilenameFromLine(String line);

    /**
     * This one is responsible for code highlighting. A java extractor might return java here while a xml extractor
     * return xml here.
     */
    String getLanguage();

}