KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > gsf > Error


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.api.gsf;
21
22 import org.openide.filesystems.FileObject;
23
24 /**
25  * This represents an error registered for the current java source,
26  * possibly with associated fix proposals.
27  *
28  * @todo Add a getArgs() method etc. such that error messages can be parameterized; see javax.tools.DiagnosticMessage
29  *
30  * @author Tor Norbye
31  */

32 public interface Error {
33     /**
34      * Provide a short user-visible (and therefore localized) description of this error
35      */

36     String JavaDoc getDisplayName();
37
38     /**
39      * Provide a full sentence description of this item, suitable for display in a tooltip
40      * for example
41      */

42     String JavaDoc getDescription();
43
44     /**
45      * Return a unique id/key for this error, such as "compiler.err.abstract.cant.be.instantiated".
46      * This key is used for error hints providers.
47      */

48     String JavaDoc getKey();
49     
50     ///**
51
// * Get the fixes associated with this error
52
// */
53
//Collection<Fix> getFixes();
54
//
55
///**
56
// * Register a fix proposal for this error
57
// */
58
//void addFix(Fix fix);
59

60     /**
61      * Get the file object associated with this error, if any
62      */

63     FileObject getFile();
64
65     /**
66      * Get the position of the error
67      * @todo Switch away from Position and just use integer offsets?
68      */

69     Position getStartPosition();
70     
71     /**
72      * Get the end position of the error, or null if unknown
73      * @todo Switch away from Position and just use integer offsets?
74      */

75     Position getEndPosition();
76     
77     /**
78      * Get the severity of this error
79      */

80     Severity getSeverity();
81     
82     /**
83      * Return optional parameters for this message. The parameters may
84      * provide the specific unknown symbol name for an unknown symbol error,
85      * etc.
86      */

87     Object JavaDoc[] getParameters();
88
89     /**
90      * Set optional parameters for this message.
91      *
92      * @see #getParameters
93      *
94      * @param parameters The array of parameters
95      */

96     void setParameters(Object JavaDoc[] parameters);
97 }
98
Popular Tags