Class ResourceContext

  extended by
      extended by
Direct Known Subclasses:

public class ResourceContext
extends Context

A Context used when checking resource files (both bitmaps and XML files; for XML files a subclass of this context is used: XmlContext.)

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
Fields inherited from class
file, mDriver
Constructor Summary
ResourceContext(LintDriver driver, Project project, Project main, file, folderType)
          Construct a new ResourceContext
Method Summary
 int getFolderVersion()
          Returns the folder version. getResourceFolderType()
          Returns the resource folder type of this XML file, if any.
Methods inherited from class
containsCommentSuppress, getClient, getConfiguration, getContents, getDriver, getMainProject, getPhase, getProject, getProperty, getScope, getSdkInfo, getSuppressCommentPrefix, isEnabled, isSuppressedWithComment, log, report, report, requestRepeat, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ResourceContext(@NonNull
                       LintDriver driver,
                       Project project,
                       Project main,
Construct a new ResourceContext

driver - the driver running through the checks
project - the project containing the file being checked
main - 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 being checked
folderType - the ResourceFolderType of this file, if any
Method Detail


public getResourceFolderType()
Returns the resource folder type of this XML file, if any.

the resource folder type or null


public int getFolderVersion()
Returns the folder version. For example, for the file values-v14/foo.xml, it returns 14.

the folder version, or -1 if no specific version was specified