public final class Result
extends java.lang.Object
Result
s created during type-checking can be reported using SourceChecker.report(org.checkerframework.framework.source.Result, java.lang.Object)
, which ultimately delivers an error or warning message via the JSR 199
compiler interface.Modifier and Type | Class and Description |
---|---|
static class |
Result.DiagMessage
A class that represents diagnostic messages.
|
Modifier and Type | Field and Description |
---|---|
static Result |
SUCCESS
The success result.
|
Modifier and Type | Method and Description |
---|---|
static Result |
failure(@CompilerMessageKey java.lang.String messageKey,
java.lang.Object... args)
Creates a new failure result with the given message key.
|
java.util.List<Result.DiagMessage> |
getDiagMessages() |
java.util.List<java.lang.String> |
getMessageKeys() |
boolean |
isFailure() |
boolean |
isSuccess() |
boolean |
isWarning() |
Result |
merge(Result r)
Merges two results into one.
|
java.lang.String |
toString() |
static Result |
warning(@CompilerMessageKey java.lang.String messageKey,
java.lang.Object... args)
Creates a new warning result with the given message.
|
public static final Result SUCCESS
public static Result failure(@CompilerMessageKey java.lang.String messageKey, java.lang.Object... args)
messageKey
- the key representing the reason for failureargs
- optional arguments to be included in the messagepublic static Result warning(@CompilerMessageKey java.lang.String messageKey, java.lang.Object... args)
messageKey
- the key for the warning messageargs
- optional arguments to be included in the messagepublic Result merge(Result r)
r
- the result to merge with this resultr
are success results,
or a result that has the more significant type (failure > warning > success) and
the message keys of both this result and r
public boolean isSuccess()
public boolean isFailure()
public boolean isWarning()
public java.util.List<java.lang.String> getMessageKeys()
public java.util.List<Result.DiagMessage> getDiagMessages()
@SideEffectFree public java.lang.String toString()
toString
in class java.lang.Object