|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.tools.lint.detector.api.Context
com.android.tools.lint.detector.api.JavaContext
public class JavaContext
A Context used when checking Java files.
| Field Summary | |
|---|---|
lombok.ast.Node |
compilationUnit
The parse tree |
IJavaParser |
parser
The parser which produced the parse tree |
| Fields inherited from class com.android.tools.lint.detector.api.Context |
|---|
file, mDriver |
| Constructor Summary | |
|---|---|
JavaContext(LintDriver driver,
Project project,
Project main,
java.io.File file)
Constructs a JavaContext for running lint on the given file, with
the given scope, in the given project reporting errors to the given
client. |
|
| Method Summary | |
|---|---|
static lombok.ast.ClassDeclaration |
findSurroundingClass(lombok.ast.Node scope)
|
static lombok.ast.Node |
findSurroundingMethod(lombok.ast.Node scope)
|
Location |
getLocation(lombok.ast.Node node)
Returns a location for the given node |
protected java.lang.String |
getSuppressCommentPrefix()
Returns the comment marker used in Studio to suppress statements for language, if any |
boolean |
isSuppressed(lombok.ast.Node scope,
Issue issue)
|
void |
report(Issue issue,
Location location,
java.lang.String message,
java.lang.Object data)
Reports an issue. |
void |
report(Issue issue,
lombok.ast.Node scope,
Location location,
java.lang.String message,
java.lang.Object data)
Reports an issue applicable to a given AST node. |
| Methods inherited from class com.android.tools.lint.detector.api.Context |
|---|
containsCommentSuppress, getClient, getConfiguration, getContents, getDriver, getFolderVersion, getFolderVersion, getMainProject, getPhase, getProject, getProperty, getScope, getSdkInfo, isEnabled, isSuppressedWithComment, log, requestRepeat, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public lombok.ast.Node compilationUnit
public IJavaParser parser
| Constructor Detail |
|---|
public JavaContext(@NonNull
LintDriver driver,
@NonNull
Project project,
@Nullable
Project main,
@NonNull
java.io.File file)
JavaContext for running lint on the given file, with
the given scope, in the given project reporting errors to the given
client.
driver - the driver running through the checksproject - the project to run lint on which contains the given filemain - the main project if this project is a library project, or
null if this is not a library project. The main project is
the root project of all library projects, not necessarily the
directly including project.file - the file to be analyzed| Method Detail |
|---|
@NonNull
public Location getLocation(@NonNull
lombok.ast.Node node)
node - the AST node to get a location for
public void report(@NonNull
Issue issue,
@Nullable
Location location,
@NonNull
java.lang.String message,
@Nullable
java.lang.Object data)
ContextLintClient.report(com.android.tools.lint.detector.api.Context, com.android.tools.lint.detector.api.Issue, com.android.tools.lint.detector.api.Severity, com.android.tools.lint.detector.api.Location, java.lang.String, java.lang.Object)
report in class Contextissue - the issue to reportlocation - the location of the issue, or null if not knownmessage - the message for this warningdata - any associated data, or null
public void report(@NonNull
Issue issue,
@Nullable
lombok.ast.Node scope,
@Nullable
Location location,
@NonNull
java.lang.String message,
@Nullable
java.lang.Object data)
issue - the issue to reportscope - the AST node scope the error applies to. The lint infrastructure
will check whether there are suppress annotations on this node (or its enclosing
nodes) and if so suppress the warning without involving the client.location - the location of the issue, or null if not knownmessage - the message for this warningdata - any associated data, or null@Nullable public static lombok.ast.Node findSurroundingMethod(lombok.ast.Node scope)
@Nullable public static lombok.ast.ClassDeclaration findSurroundingClass(lombok.ast.Node scope)
@Nullable protected java.lang.String getSuppressCommentPrefix()
Context
getSuppressCommentPrefix in class Context
public boolean isSuppressed(@NonNull
lombok.ast.Node scope,
@NonNull
Issue issue)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||