|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.javac.util.JCDiagnostic
public class JCDiagnostic
An abstraction of a diagnostic message generated by the compiler.
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Nested Class Summary | |
|---|---|
static interface |
JCDiagnostic.DiagnosticPosition
A DiagnosticPosition provides information about the positions in a file that gave rise to a diagnostic. |
static class |
JCDiagnostic.DiagnosticType
A DiagnosticType defines the type of the diagnostic. |
static class |
JCDiagnostic.Factory
A factory for creating diagnostic objects. |
static class |
JCDiagnostic.MultilineDiagnostic
|
static class |
JCDiagnostic.SimpleDiagnosticPosition
A DiagnosticPosition that simply identifies a position, but no related tree node, as the location for a diagnostic. |
| Nested classes/interfaces inherited from interface javax.tools.Diagnostic |
|---|
Diagnostic.Kind |
| Field Summary | |
|---|---|
protected java.lang.Object[] |
args
|
private int |
column
|
private DiagnosticFormatter<JCDiagnostic> |
defaultFormatter
|
private static DiagnosticFormatter<JCDiagnostic> |
fragmentFormatter
Deprecated. |
private java.lang.String |
key
|
private int |
line
|
private boolean |
mandatory
|
private JCDiagnostic.DiagnosticPosition |
position
|
private DiagnosticSource |
source
|
private JCDiagnostic.DiagnosticType |
type
|
| Fields inherited from interface javax.tools.Diagnostic |
|---|
NOPOS |
| Constructor Summary | |
|---|---|
protected |
JCDiagnostic(DiagnosticFormatter<JCDiagnostic> formatter,
JCDiagnostic.DiagnosticType dt,
boolean mandatory,
DiagnosticSource source,
JCDiagnostic.DiagnosticPosition pos,
java.lang.String key,
java.lang.Object... args)
Create a diagnostic object. |
| Method Summary | |
|---|---|
static JCDiagnostic |
fragment(java.lang.String key,
java.lang.Object... args)
Deprecated. |
java.lang.Object[] |
getArgs()
Get the arguments to be included in the text of the diagnostic. |
java.lang.String |
getCode()
Gets a diagnostic code indicating the type of diagnostic. |
long |
getColumnNumber()
Get the column number within the line of source referred to by this diagnostic. |
DiagnosticSource |
getDiagnosticSource()
Get the source referred to by this diagnostic. |
long |
getEndPosition()
Gets the character offset from the beginning of the file associated with this diagnostic that indicates the end of the problem. |
static DiagnosticFormatter<JCDiagnostic> |
getFragmentFormatter()
Deprecated. |
protected int |
getIntEndPosition()
|
protected int |
getIntPosition()
|
protected int |
getIntStartPosition()
|
Diagnostic.Kind |
getKind()
Gets the kind of this diagnostic, for example, error or warning. |
long |
getLineNumber()
Get the line number within the source referred to by this diagnostic. |
java.lang.String |
getMessage(java.util.Locale locale)
Gets a localized message for the given locale. |
long |
getPosition()
Gets a character offset from the beginning of the source object associated with this diagnostic that indicates the location of the problem. |
java.lang.String |
getPrefix()
Get the prefix string associated with this type of diagnostic. |
java.lang.String |
getPrefix(JCDiagnostic.DiagnosticType dt)
Get the prefix string associated with a particular type of diagnostic. |
JavaFileObject |
getSource()
Get the name of the source file referred to by this diagnostic. |
java.lang.String |
getSourceName()
Get the name of the source file referred to by this diagnostic. |
long |
getStartPosition()
Gets the character offset from the beginning of the file associated with this diagnostic that indicates the start of the problem. |
List<JCDiagnostic> |
getSubdiagnostics()
Get the subdiagnostic list |
JCDiagnostic.DiagnosticType |
getType()
Get the type of this diagnostic. |
boolean |
isMandatory()
Check whether or not this diagnostic is required to be shown. |
boolean |
isMultiline()
|
java.lang.String |
toString()
Return the standard presentation of this diagnostic. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final JCDiagnostic.DiagnosticType type
private final DiagnosticSource source
private final JCDiagnostic.DiagnosticPosition position
private final int line
private final int column
private final java.lang.String key
protected java.lang.Object[] args
private boolean mandatory
private DiagnosticFormatter<JCDiagnostic> defaultFormatter
@Deprecated private static DiagnosticFormatter<JCDiagnostic> fragmentFormatter
| Constructor Detail |
|---|
protected JCDiagnostic(DiagnosticFormatter<JCDiagnostic> formatter,
JCDiagnostic.DiagnosticType dt,
boolean mandatory,
DiagnosticSource source,
JCDiagnostic.DiagnosticPosition pos,
java.lang.String key,
java.lang.Object... args)
messages - the resource for localized messagesdt - the type of diagnosticname - the name of the source file, or null if none.pos - the character offset within the source file, if given.key - a resource key to identify the text of the diagnosticargs - arguments to be included in the text of the diagnostic| Method Detail |
|---|
@Deprecated
public static JCDiagnostic fragment(java.lang.String key,
java.lang.Object... args)
key - The key for the localized error message.args - Fields of the error message.@Deprecated public static DiagnosticFormatter<JCDiagnostic> getFragmentFormatter()
public JCDiagnostic.DiagnosticType getType()
public List<JCDiagnostic> getSubdiagnostics()
public boolean isMultiline()
public boolean isMandatory()
public JavaFileObject getSource()
getSource in interface Diagnostic<JavaFileObject>public java.lang.String getSourceName()
public DiagnosticSource getDiagnosticSource()
protected int getIntStartPosition()
protected int getIntPosition()
protected int getIntEndPosition()
public long getStartPosition()
Diagnostic
getStartPosition in interface Diagnostic<JavaFileObject>Diagnostic.NOPOS if and
only if Diagnostic.getPosition() returns Diagnostic.NOPOSpublic long getPosition()
DiagnosticgetStartPostion() <= getPosition()
getPosition() <= getEndPosition()
getPosition in interface Diagnostic<JavaFileObject>Diagnostic.NOPOS if Diagnostic.getSource() would return null or if
no location is suitablepublic long getEndPosition()
Diagnostic
getEndPosition in interface Diagnostic<JavaFileObject>Diagnostic.NOPOS if and
only if Diagnostic.getPosition() returns Diagnostic.NOPOSpublic long getLineNumber()
getLineNumber in interface Diagnostic<JavaFileObject>public long getColumnNumber()
getColumnNumber in interface Diagnostic<JavaFileObject>public java.lang.Object[] getArgs()
public java.lang.String getPrefix()
public java.lang.String getPrefix(JCDiagnostic.DiagnosticType dt)
public java.lang.String toString()
toString in class java.lang.Objectpublic Diagnostic.Kind getKind()
Diagnostic
getKind in interface Diagnostic<JavaFileObject>public java.lang.String getCode()
Diagnosticnull.
getCode in interface Diagnostic<JavaFileObject>public java.lang.String getMessage(java.util.Locale locale)
Diagnosticnull use the default locale.
getMessage in interface Diagnostic<JavaFileObject>locale - a locale; might be null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||