com.android.tools.lint.detector.api
Class Context
java.lang.Object
com.android.tools.lint.detector.api.Context
public class Context
- extends Object
Context passed to the detectors during an analysis run. It provides
information about the file being analyzed, it allows shared properties (so
the detectors can share results), it contains the current location in the
document, etc.
TODO: This needs some cleanup. Perhaps we should split up into a FileContext
and a ProjectContext.
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
project
public final Project project
file
public final File file
client
public final LintClient client
configuration
public final Configuration configuration
scope
public final EnumSet<Scope> scope
document
public Document document
location
public Location location
element
public Element element
parser
public IDomParser parser
canceled
public final AtomicBoolean canceled
- Slow-running detectors should check this flag via
AtomicBoolean.get() and abort if canceled
Context
public Context(LintClient client,
Project project,
File file,
EnumSet<Scope> scope)
getLocation
public Location getLocation(Node node)
getLocation
public Location getLocation(Context context)
getContents
public String getContents()
getProperty
public Object getProperty(String name)
setProperty
public void setProperty(String name,
Object value)
Copyright © 2008-2012. All Rights Reserved.