com.android.tools.lint.detector.api
Class Location

java.lang.Object
  extended by com.android.tools.lint.detector.api.Location

public class Location
extends Object

Location information for a warning

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 Summary
Location(File file, Position start, Position end)
          Constructs a new location range for the given file, from start to end.
 
Method Summary
 Position getEnd()
          The end position of the range
 File getFile()
          Returns the file containing the warning.
 Location getSecondary()
          Returns a secondary location associated with this location (if applicable), or null.
 Position getStart()
          The start position of the range
 void setSecondary(Location secondary)
          Sets a secondary location for this location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Location

public Location(File file,
                Position start,
                Position end)
Constructs a new location range for the given file, from start to end. If the length of the range is not known, end may be null.

Parameters:
file - the associated file (but see the documentation for getFile() for more information on what the file represents)
start - the starting position, never null
end - the ending position, or null
Method Detail

getFile

public File getFile()
Returns the file containing the warning. Note that the file *itself* may not yet contain the error. When editing a file in the IDE for example, the tool could generate warnings in the background even before the document is saved. However, the file is used as a identifying token for the document being edited, and the IDE integration can map this back to error locations in the editor source code.

Returns:
the file handle for the location

getStart

public Position getStart()
The start position of the range

Returns:
the start position of the range, never null

getEnd

public Position getEnd()
The end position of the range

Returns:
the start position of the range, may be null for an empty range

getSecondary

public Location getSecondary()
Returns a secondary location associated with this location (if applicable), or null.

Returns:
a secondary location or null

setSecondary

public void setSecondary(Location secondary)
Sets a secondary location for this location.

Parameters:
secondary - a secondary location associated with this location


Copyright © 2008-2012. All Rights Reserved.