KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > ui > text > java > IProblemLocation


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.ui.text.java;
12
13 import org.eclipse.jdt.core.dom.ASTNode;
14 import org.eclipse.jdt.core.dom.CompilationUnit;
15
16
17 /**
18  * Problem information for quick fix and quick assist processors.
19  * <p>
20  * Note: this interface is not intended to be implemented.
21  * </p>
22  *
23  * @since 3.0
24  */

25 public interface IProblemLocation {
26
27     /**
28      * Returns the start offset of the problem.
29      *
30      * @return the start offset of the problem
31      */

32     int getOffset();
33
34     /**
35      * Returns the length of the problem.
36      *
37      * @return the length of the problem
38      */

39     int getLength();
40
41     /**
42      * Returns the marker type of this problem.
43      *
44      * @return The marker type of the problem.
45      * @since 3.2
46      */

47     String JavaDoc getMarkerType();
48     
49     /**
50      * Returns the id of problem. Note that problem ids are defined per problem marker type.
51      * See {@link org.eclipse.jdt.core.compiler.IProblem} for id definitions for problems of type
52      * <code>org.eclipse.jdt.core.problem</code> and <code>org.eclipse.jdt.core.task</code>.
53      *
54      * @return The id of the problem.
55      */

56     int getProblemId();
57
58     /**
59      * Returns the original arguments recorded into the problem.
60      *
61      * @return String[] Returns the problem arguments.
62      */

63     String JavaDoc[] getProblemArguments();
64
65     /**
66      * Returns if the problem has error severity.
67      *
68      * @return <code>true</code> if the problem has error severity
69      */

70     boolean isError();
71
72     /**
73      * Convenience method to evaluate the AST node covering this problem.
74      *
75      * @param astRoot The root node of the current AST
76      * @return Returns the node that covers the location of the problem
77      */

78     ASTNode getCoveringNode(CompilationUnit astRoot);
79
80     /**
81      * Convenience method to evaluate the AST node covered by this problem.
82      *
83      * @param astRoot The root node of the current AST
84      * @return Returns the node that is covered by the location of the problem
85      */

86     ASTNode getCoveredNode(CompilationUnit astRoot);
87
88 }
89
Popular Tags