Save This Page
Home » Open-JDK-6.b17-src » javax » tools » [javadoc | source]
javax.tools
public interface: Diagnostic [javadoc | source] Interface for diagnostics from tools. A diagnostic usually reports a problem at a specific position in a source file. However, not all diagnostics are associated with a position or a file.

A position is a zero-based character offset from the beginning of a file. Negative values (except #NOPOS ) are not valid positions.

Line and column numbers begin at 1. Negative values (except #NOPOS ) and 0 are not valid line or column numbers.

Nested Class Summary:
enum class  Diagnostic.Kind  Kinds of diagnostics, for example, error or warning. 
Field Summary
public static final  long NOPOS    Used to signal that no position is available. 
Method from javax.tools.Diagnostic Summary:
getCode,   getColumnNumber,   getEndPosition,   getKind,   getLineNumber,   getMessage,   getPosition,   getSource,   getStartPosition
Method from javax.tools.Diagnostic Detail:
 public String getCode()
    Gets a diagnostic code indicating the type of diagnostic. The code is implementation-dependent and might be {@code null}.
 public long getColumnNumber()
    Gets the column number of the character offset returned by {@linkplain #getPosition()}.
 public long getEndPosition()
    Gets the character offset from the beginning of the file associated with this diagnostic that indicates the end of the problem.
 public Kind getKind()
    Gets the kind of this diagnostic, for example, error or warning.
 public long getLineNumber()
    Gets the line number of the character offset returned by {@linkplain #getPosition()}.
 public String getMessage(Locale locale)
    Gets a localized message for the given locale. The actual message is implementation-dependent. If the locale is {@code null} use the default locale.
 public long getPosition()
    Gets a character offset from the beginning of the source object associated with this diagnostic that indicates the location of the problem. In addition, the following must be true:

    {@code getStartPostion() <= getPosition()}

    {@code getPosition() <= getEndPosition()}

 public S getSource()
    Gets the source object associated with this diagnostic.
 public long getStartPosition()
    Gets the character offset from the beginning of the file associated with this diagnostic that indicates the start of the problem.