javax.tools
Interface Diagnostic<S>

Type Parameters:
S - the type of the source object

public interface Diagnostic<S>

Encapsulates diagnostic information from a tool. This usually includes (but is not required) a position in a source file, line and column number information and a message.

Since:
1.6

Nested Class Summary
static class Diagnostic.Kind
          The kind of diagnostic information.
 
Field Summary
static long NOPOS
          Indicates that this diagnostic object doesn't carry position information.
 
Method Summary
 String getCode()
          Return a diagnostic code.
 long getColumnNumber()
          Returns the column number or NOPOS, indicating that this doesn't carry position information.
 long getEndPosition()
           
 Diagnostic.Kind getKind()
          Returns the kind of this diagnostic object.
 long getLineNumber()
          Returns the line number or NOPOS, indicating that this doesn't carry position information.
 String getMessage(Locale locale)
          Returns a localized message.
 long getPosition()
          Returns the position in the source object.
 S getSource()
          Returns the source of this diagnostic object.
 long getStartPosition()
          Returns the start position in the source object.
 

Field Detail

NOPOS

static final long NOPOS
Indicates that this diagnostic object doesn't carry position information.

See Also:
Constant Field Values
Method Detail

getKind

Diagnostic.Kind getKind()
Returns the kind of this diagnostic object.

Returns:
the kind of this diagnostic object

getSource

S getSource()
Returns the source of this diagnostic object.

Returns:
the source of this diagnostic object

getPosition

long getPosition()
Returns the position in the source object. This is a zero based value, or NOPOS, indicating that this doesn't carry position information.

Returns:
the position in the source object

getStartPosition

long getStartPosition()
Returns the start position in the source object. This is a zero based value, or NOPOS, indicating that this doesn't carry position information.

Returns:
the start position in the source object

getEndPosition

long getEndPosition()

getLineNumber

long getLineNumber()
Returns the line number or NOPOS, indicating that this doesn't carry position information. This is a 1-based value indicating the line in the source object.

Returns:
the line number

getColumnNumber

long getColumnNumber()
Returns the column number or NOPOS, indicating that this doesn't carry position information. This is a 1-based value indicating the column in the source object.

Returns:
the column number

getCode

String getCode()
Return a diagnostic code. This is implementation dependend and might be null.

Returns:
a diagnostic code or null

getMessage

String getMessage(Locale locale)
Returns a localized message. This is implementation dependend. If locale is null this uses the default locale.

Parameters:
locale - the locale, or null
Returns:
a localized message