- 
- Type Parameters:
- S- the type of source object used by this diagnostic
 
 public interface Diagnostic<S>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.- Since:
- 1.6
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classDiagnostic.KindKinds of diagnostics, for example, error or warning.
 - 
Field SummaryFields Modifier and Type Field Description static longNOPOSUsed to signal that no position is available.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetCode()Returns a diagnostic code indicating the type of diagnostic.longgetColumnNumber()Returns the column number of the character offset returned by getPosition().longgetEndPosition()Returns the character offset from the beginning of the file associated with this diagnostic that indicates the end of the problem.Diagnostic.KindgetKind()Returns the kind of this diagnostic, for example, error or warning.longgetLineNumber()Returns the line number of the character offset returned by getPosition().StringgetMessage(Locale locale)Returns a localized message for the given locale.longgetPosition()Returns a character offset from the beginning of the source object associated with this diagnostic that indicates the location of the problem.SgetSource()Returns the source object associated with this diagnostic.longgetStartPosition()Returns the character offset from the beginning of the file associated with this diagnostic that indicates the start of the problem.
 
- 
- 
- 
Field Detail- 
NOPOSstatic final long NOPOS Used to signal that no position is available.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getKindDiagnostic.Kind getKind() Returns the kind of this diagnostic, for example, error or warning.- Returns:
- the kind of this diagnostic
 
 - 
getSourceS getSource() Returns the source object associated with this diagnostic.- Returns:
- the source object associated with this diagnostic.
 nullif no source object is associated with the diagnostic.
 
 - 
getPositionlong getPosition() Returns 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:getStartPostion() <= getPosition()getPosition() <= getEndPosition()- Returns:
- character offset from beginning of source; NOPOSifgetSource()would returnnullor if no location is suitable
 
 - 
getStartPositionlong getStartPosition() Returns the character offset from the beginning of the file associated with this diagnostic that indicates the start of the problem.- Returns:
- offset from beginning of file; NOPOSif and only ifgetPosition()returnsNOPOS
 
 - 
getEndPositionlong getEndPosition() Returns the character offset from the beginning of the file associated with this diagnostic that indicates the end of the problem.- Returns:
- offset from beginning of file; NOPOSif and only ifgetPosition()returnsNOPOS
 
 - 
getLineNumberlong getLineNumber() Returns the line number of the character offset returned by getPosition().- Returns:
- a line number or NOPOSif and only ifgetPosition()returnsNOPOS
 
 - 
getColumnNumberlong getColumnNumber() Returns the column number of the character offset returned by getPosition().- Returns:
- a column number or NOPOSif and only ifgetPosition()returnsNOPOS
 
 - 
getCodeString getCode() Returns a diagnostic code indicating the type of diagnostic. The code is implementation-dependent and might benull.- Returns:
- a diagnostic code
 
 
- 
 
-