Class Description
java.lang.Object
com.google.errorprone.matchers.Description
Simple data object containing the information captured about an AST match. Can be printed in a
UI, or output in structured format for use by tools.
- Author:
- alexeagle@google.com (Alex Eagle)
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
The name of the check that produced the match.final com.google.common.collect.ImmutableList
<Fix> A list of fixes to suggest in an error message or use in automated refactoring.static final Description
Describes the sentinel value of the case where the match failed.final com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition
The position of the match. -
Method Summary
Modifier and TypeMethodDescriptionInternal-only.static Description.Builder
Returns a new builder forDescription
s.static Description.Builder
Returns a new builder forDescription
s.static Description.Builder
builder
(com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition position, String name, @Nullable String link, String message) Returns a new builder forDescription
s.@Nullable String
getLink()
Returns a link associated with this finding or null if there is no link.Returns the message to be printed by the compiler when a match is found in interactive use.Returns the message, not including the check name but including the link.Returns the raw message, not including a link or check name.severity()
-
Field Details
-
NO_MATCH
Describes the sentinel value of the case where the match failed. -
position
public final com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition positionThe position of the match. -
checkName
The name of the check that produced the match. -
fixes
A list of fixes to suggest in an error message or use in automated refactoring. Fixes are in order of decreasing preference, from most preferred to least preferred.
-
-
Method Details
-
severity
-
getMessage
Returns the message to be printed by the compiler when a match is found in interactive use. Includes the name of the check and a link for more information. -
getLink
Returns a link associated with this finding or null if there is no link. -
getRawMessage
Returns the raw message, not including a link or check name. -
getMessageWithoutCheckName
Returns the message, not including the check name but including the link. -
applySeverityOverride
Internal-only. -
builder
public static Description.Builder builder(com.sun.source.tree.Tree node, String name, @Nullable String link, String message) Returns a new builder forDescription
s. -
builder
public static Description.Builder builder(com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition position, String name, @Nullable String link, String message) Returns a new builder forDescription
s. -
builder
public static Description.Builder builder(com.sun.tools.javac.tree.JCTree tree, String name, @Nullable String link, String message) Returns a new builder forDescription
s.
-