01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.ui.text.java;
11:
12: import org.eclipse.jdt.core.dom.ASTNode;
13: import org.eclipse.jdt.core.dom.CompilationUnit;
14:
15: /**
16: * Problem information for quick fix and quick assist processors.
17: * <p>
18: * Note: this interface is not intended to be implemented.
19: * </p>
20: *
21: * @since 3.0
22: */
23: public interface IProblemLocation {
24:
25: /**
26: * Returns the start offset of the problem.
27: *
28: * @return the start offset of the problem
29: */
30: int getOffset();
31:
32: /**
33: * Returns the length of the problem.
34: *
35: * @return the length of the problem
36: */
37: int getLength();
38:
39: /**
40: * Returns the marker type of this problem.
41: *
42: * @return The marker type of the problem.
43: * @since 3.2
44: */
45: String getMarkerType();
46:
47: /**
48: * Returns the id of problem. Note that problem ids are defined per problem marker type.
49: * See {@link org.eclipse.jdt.core.compiler.IProblem} for id definitions for problems of type
50: * <code>org.eclipse.jdt.core.problem</code> and <code>org.eclipse.jdt.core.task</code>.
51: *
52: * @return The id of the problem.
53: */
54: int getProblemId();
55:
56: /**
57: * Returns the original arguments recorded into the problem.
58: *
59: * @return String[] Returns the problem arguments.
60: */
61: String[] getProblemArguments();
62:
63: /**
64: * Returns if the problem has error severity.
65: *
66: * @return <code>true</code> if the problem has error severity
67: */
68: boolean isError();
69:
70: /**
71: * Convenience method to evaluate the AST node covering this problem.
72: *
73: * @param astRoot The root node of the current AST
74: * @return Returns the node that covers the location of the problem
75: */
76: ASTNode getCoveringNode(CompilationUnit astRoot);
77:
78: /**
79: * Convenience method to evaluate the AST node covered by this problem.
80: *
81: * @param astRoot The root node of the current AST
82: * @return Returns the node that is covered by the location of the problem
83: */
84: ASTNode getCoveredNode(CompilationUnit astRoot);
85:
86: }
|