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

oms3.nap.AnnotationHandler Maven / Gradle / Ivy

There is a newer version: 0.8.1
Show newest version
package oms3.nap;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * Annotation Handler.
 *
 * Implement this interface to handle annotations. The processor will
 * call this handler once with start(), then handle(..) n-times 
 * for n annotated lines,
 * and finally done() when done with this file.
 *
 * @author od
 */
public interface AnnotationHandler {

    public static final String VALUE = "value";

    /**
     * Called by the processor when starting processing annotations for a file.
     *
     * @param file the file that is processed as String.
     */
    void start(String src);

    /**
     * Handles a single line of annotated code.
     *
     * @param annValue      annotations KVPs in a map. It is empty if there
     *                       is no annotation argument (tagging annotation), annValue.get("value") will
     *                       return a single value argument.
     * @param rcLine    the source line that follows the annotations, if there
     *                       is none (e.g. another annotation follows), the value will be null.
     */
    void handle(Map> ann, String srcLine);

    /**
     * Logging during parsing
     * @param msg
     */
    void log(String msg);

    /**
     * Done with file processing.
     * @throws Exception 
     */
    void done() throws Exception;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy