javax.tools

Interface Diagnostic<S>

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.

Parameters: the type of the source object

Since: 1.6

Nested Class Summary
static classDiagnostic.Kind
The kind of diagnostic information.
Field Summary
static longNOPOS
Indicates that this diagnostic object doesn't carry position information.
Method Summary
StringgetCode()
Return a diagnostic code.
longgetColumnNumber()
Returns the column number or NOPOS, indicating that this doesn't carry position information.
longgetEndPosition()
Diagnostic.KindgetKind()
Returns the kind of this diagnostic object.
longgetLineNumber()
Returns the line number or NOPOS, indicating that this doesn't carry position information.
StringgetMessage(Locale locale)
Returns a localized message.
longgetPosition()
Returns the position in the source object.
SgetSource()
Returns the source of this diagnostic object.
longgetStartPosition()
Returns the start position in the source object.

Field Detail

NOPOS

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

Method Detail

getCode

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

Returns: a diagnostic code or null

getColumnNumber

public 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

getEndPosition

public long getEndPosition()

getKind

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

Returns: the kind of this diagnostic object

getLineNumber

public 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

getMessage

public 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

getPosition

public 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

getSource

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

Returns: the source of this diagnostic object

getStartPosition

public 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