Diagnostic (Java SE 16 & JDK 16) (original) (raw)

Type Parameters:

S - the type of source object used by this diagnostic


public interface Diagnostic

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 (exceptNOPOS) and 0 are not valid line or column numbers.

Since:

1.6

Nested Classes
static class
Kinds of diagnostics, for example, error or warning.

Fields
static long
Used to signal that no position is available.

[getCode](#getCode%28%29)()
Returns a diagnostic code indicating the type of diagnostic.
long
Returns the column number of the character offset returned bygetPosition().
long
Returns the character offset from the beginning of the file associated with this diagnostic that indicates the end of the problem.
[getKind](#getKind%28%29)()
Returns the kind of this diagnostic, for example, error or warning.
long
Returns the line number of the character offset returned bygetPosition().
Returns a localized message for the given locale.
long
Returns a character offset from the beginning of the source object associated with this diagnostic that indicates the location of the problem.
[getSource](#getSource%28%29)()
Returns the source object associated with this diagnostic.
long
Returns the character offset from the beginning of the file associated with this diagnostic that indicates the start of the problem.