com.android.tools.lint.client.api
Class IssueRegistry

java.lang.Object
  extended by com.android.tools.lint.client.api.IssueRegistry

@Beta
public abstract class IssueRegistry
extends java.lang.Object

Registry which provides a list of checks to be performed on an Android project

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your code for the next tools release.


Field Summary
static Issue CANCELLED
          Issue reported when lint is canceled
static Issue LINT_ERROR
          Issue reported by lint for various other issues which prevents lint from running normally when it's not necessarily an error in the user's code base.
static Issue PARSER_ERROR
          Issue reported by lint (not a specific detector) when it cannot even parse an XML file prior to analysis
 
Constructor Summary
protected IssueRegistry()
          Creates a new IssueRegistry
 
Method Summary
 java.util.List<Category> getCategories()
          Returns the available categories
 Issue getIssue(java.lang.String id)
          Returns the issue for the given id, or null if it's not a valid id
protected  int getIssueCapacity(java.util.EnumSet<Scope> scope)
          Get an approximate issue count for a given scope.
abstract  java.util.List<Issue> getIssues()
          Returns the list of issues that can be found by all known detectors.
protected  java.util.List<Issue> getIssuesForScope(java.util.EnumSet<Scope> scope)
          Returns all available issues of a given scope (regardless of whether they are actually enabled for a given configuration etc)
 boolean isCategoryName(java.lang.String name)
          Returns true if the given category is a valid category
 boolean isIssueId(java.lang.String id)
          Returns true if the given id represents a valid issue id
protected static void reset()
          Reset the registry such that it recomputes its available issues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARSER_ERROR

@NonNull
public static final Issue PARSER_ERROR
Issue reported by lint (not a specific detector) when it cannot even parse an XML file prior to analysis


LINT_ERROR

@NonNull
public static final Issue LINT_ERROR
Issue reported by lint for various other issues which prevents lint from running normally when it's not necessarily an error in the user's code base.


CANCELLED

@NonNull
public static final Issue CANCELLED
Issue reported when lint is canceled

Constructor Detail

IssueRegistry

protected IssueRegistry()
Creates a new IssueRegistry

Method Detail

getIssues

@NonNull
public abstract java.util.List<Issue> getIssues()
Returns the list of issues that can be found by all known detectors.

Returns:
the list of issues to be checked (including those that may be disabled!)

getIssueCapacity

protected int getIssueCapacity(@NonNull
                               java.util.EnumSet<Scope> scope)
Get an approximate issue count for a given scope. This is just an optimization, so the number does not have to be accurate.

Parameters:
scope - the scope set
Returns:
an approximate ceiling of the number of issues expected for a given scope set

getIssuesForScope

@NonNull
protected java.util.List<Issue> getIssuesForScope(@NonNull
                                                          java.util.EnumSet<Scope> scope)
Returns all available issues of a given scope (regardless of whether they are actually enabled for a given configuration etc)

Parameters:
scope - the applicable scope set
Returns:
a list of issues

isIssueId

public final boolean isIssueId(@NonNull
                               java.lang.String id)
Returns true if the given id represents a valid issue id

Parameters:
id - the id to be checked
Returns:
true if the given id is valid

isCategoryName

public final boolean isCategoryName(@NonNull
                                    java.lang.String name)
Returns true if the given category is a valid category

Parameters:
name - the category name to be checked
Returns:
true if the given string is a valid category

getCategories

@NonNull
public java.util.List<Category> getCategories()
Returns the available categories

Returns:
an iterator for all the categories, never null

getIssue

@Nullable
public final Issue getIssue(@NonNull
                                     java.lang.String id)
Returns the issue for the given id, or null if it's not a valid id

Parameters:
id - the id to be checked
Returns:
the corresponding issue, or null

reset

protected static void reset()
Reset the registry such that it recomputes its available issues.

NOTE: This is only intended for testing purposes.