001    /*
002      Copyright (C) 2002 Laurent Martelli <laurent@aopsys.com>
003    
004      This program is free software; you can redistribute it and/or modify
005      it under the terms of the GNU Lesser General Public License as
006      published by the Free Software Foundation; either version 2 of the
007      License, or (at your option) any later version.
008    
009      This program is distributed in the hope that it will be useful,
010      but WITHOUT ANY WARRANTY; without even the implied warranty of
011      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012      GNU Lesser General Public License for more details.
013    
014      You should have received a copy of the GNU Lesser General Public
015      License along with this program; if not, write to the Free Software
016      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
017      USA */
018    
019    package org.objectweb.jac.ide;
020    
021    import java.io.File;
022    
023    /**
024     * An error generated by the compilator
025     */
026    
027    public class Error {
028    
029        File file;
030        int line = 0;
031        String message;
032        Class cl;
033       
034        /**
035         * Creates an error message with no associated file,class or line number
036         */
037        public Error(String message) {
038            this.message = message;      
039        }
040    
041        public Error(String fileName, int line, String message, Class cl) {
042            this.file = new File(fileName);
043            this.line = line;
044            this.message = message;
045            this.cl = cl;
046        }
047       
048        public Class getCl() {
049            return cl;
050        }
051    
052        public int getLine() {
053            return line;
054        }
055    
056        public String message() {
057            return message;
058        }
059    
060        public String toString() {
061            return message;
062        }
063    }