@Beta public class ResourceContext extends Context
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.
| Constructor and Description |
|---|
ResourceContext(LintDriver driver,
Project project,
Project main,
java.io.File file,
com.android.resources.ResourceFolderType folderType)
Construct a new
ResourceContext |
| Modifier and Type | Method and Description |
|---|---|
com.android.ide.common.resources.configuration.FolderConfiguration |
getFolderConfiguration()
Returns the
FolderConfiguration that this resource context belongs to |
int |
getFolderVersion()
Returns the folder version.
|
protected java.io.File |
getResourceFolder()
Returns the resource folder that this resource context corresponds to, if applicable
|
com.android.resources.ResourceFolderType |
getResourceFolderType()
Returns the resource folder type of this XML file, if any.
|
containsCommentSuppress, getClient, getConfiguration, getContents, getDriver, getMainProject, getPhase, getProject, getProperty, getScope, getSdkInfo, getSuppressCommentPrefix, isEnabled, isSuppressedWithComment, log, report, report, report, requestRepeat, setPropertypublic ResourceContext(@NonNull
LintDriver driver,
@NonNull
Project project,
@Nullable
Project main,
@NonNull
java.io.File file,
@Nullable
com.android.resources.ResourceFolderType folderType)
ResourceContextdriver - the driver running through the checksproject - the project containing the file being checkedmain - 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 checkedfolderType - the ResourceFolderType of this file, if any@Nullable public com.android.resources.ResourceFolderType getResourceFolderType()
public int getFolderVersion()
@Nullable public com.android.ide.common.resources.configuration.FolderConfiguration getFolderConfiguration()
FolderConfiguration that this resource context belongs to@Nullable protected java.io.File getResourceFolder()