Modifier and Type | Field and Description |
---|---|
org.w3c.dom.Document |
document
The XML document
|
IDomParser |
parser
The XML parser
|
Constructor and Description |
---|
XmlContext(LintDriver driver,
Project project,
Project main,
java.io.File file,
com.android.resources.ResourceFolderType folderType)
Construct a new
XmlContext |
Modifier and Type | Method and Description |
---|---|
Location |
getLocation(org.w3c.dom.Node node)
Returns the location for the given node, which may be an element or an attribute.
|
Location |
getLocation(org.w3c.dom.Node textNode,
int begin,
int end)
Creates a new location within an XML text node
|
com.android.resources.ResourceFolderType |
getResourceFolderType()
Returns the resource folder type of this XML file, if any.
|
void |
report(Issue issue,
Location location,
java.lang.String message,
java.lang.Object data)
Reports an issue.
|
void |
report(Issue issue,
org.w3c.dom.Node scope,
Location location,
java.lang.String message,
java.lang.Object data)
Reports an issue applicable to a given DOM node.
|
getClient, getConfiguration, getContents, getDriver, getFolderVersion, getFolderVersion, getMainProject, getPhase, getProject, getProperty, getScope, getSdkInfo, isEnabled, log, requestRepeat, setProperty
public IDomParser parser
public org.w3c.dom.Document document
public XmlContext(@NonNull LintDriver driver, @NonNull Project project, @Nullable Project main, @NonNull java.io.File file, @Nullable com.android.resources.ResourceFolderType folderType)
XmlContext
driver
- 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@NonNull public Location getLocation(@NonNull org.w3c.dom.Node node)
node
- the node to look up the location for@NonNull public Location getLocation(@NonNull org.w3c.dom.Node textNode, int begin, int end)
textNode
- the text nodebegin
- the start offset within the text node (inclusive)end
- the end offset within the text node (exclusive)public void report(@NonNull Issue issue, @Nullable org.w3c.dom.Node scope, @Nullable Location location, @NonNull java.lang.String message, @Nullable java.lang.Object data)
issue
- the issue to reportscope
- the DOM node scope the error applies to. The lint infrastructure
will check whether there are suppress directives 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 nullpublic void report(@NonNull Issue issue, @Nullable Location location, @NonNull java.lang.String message, @Nullable java.lang.Object data)
Context
@Nullable public com.android.resources.ResourceFolderType getResourceFolderType()