001    /*
002     * Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
003     * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004     *
005     * This code is free software; you can redistribute it and/or modify it
006     * under the terms of the GNU General Public License version 2 only, as
007     * published by the Free Software Foundation.  Sun designates this
008     * particular file as subject to the "Classpath" exception as provided
009     * by Sun in the LICENSE file that accompanied this code.
010     *
011     * This code is distributed in the hope that it will be useful, but WITHOUT
012     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014     * version 2 for more details (a copy is included in the LICENSE file that
015     * accompanied this code).
016     *
017     * You should have received a copy of the GNU General Public License version
018     * 2 along with this work; if not, write to the Free Software Foundation,
019     * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020     *
021     * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022     * CA 95054 USA or visit www.sun.com if you need additional information or
023     * have any questions.
024     */
025    
026    package com.sun.mirror.apt;
027    
028    
029    import com.sun.mirror.util.SourcePosition;
030    
031    
032    /**
033     * A <tt>Messager</tt> provides the way for
034     * an annotation processor to report error messages, warnings, and
035     * other notices.
036     *
037     * @author Joseph D. Darcy
038     * @author Scott Seligman
039     * @since 1.5
040     */
041    
042    public interface Messager {
043    
044        /**
045         * Prints an error message.
046         * Equivalent to <tt>printError(null, msg)</tt>.
047         * @param msg  the message, or an empty string if none
048         */
049        void printError(String msg);
050    
051        /**
052         * Prints an error message.
053         * @param pos  the position where the error occured, or null if it is
054         *                  unknown or not applicable
055         * @param msg  the message, or an empty string if none
056         */
057        void printError(SourcePosition pos, String msg);
058    
059        /**
060         * Prints a warning message.
061         * Equivalent to <tt>printWarning(null, msg)</tt>.
062         * @param msg  the message, or an empty string if none
063         */
064        void printWarning(String msg);
065    
066        /**
067         * Prints a warning message.
068         * @param pos  the position where the warning occured, or null if it is
069         *                  unknown or not applicable
070         * @param msg  the message, or an empty string if none
071         */
072        void printWarning(SourcePosition pos, String msg);
073    
074        /**
075         * Prints a notice.
076         * Equivalent to <tt>printNotice(null, msg)</tt>.
077         * @param msg  the message, or an empty string if none
078         */
079        void printNotice(String msg);
080    
081        /**
082         * Prints a notice.
083         * @param pos  the position where the noticed occured, or null if it is
084         *                  unknown or not applicable
085         * @param msg  the message, or an empty string if none
086         */
087        void printNotice(SourcePosition pos, String msg);
088    }