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

java.lang.Object
  extended by com.android.tools.lint.detector.api.Location.DefaultLocationHandle
All Implemented Interfaces:
Location.Handle
Enclosing class:
Location

public static class Location.DefaultLocationHandle
extends java.lang.Object
implements Location.Handle

A default Location.Handle implementation for simple file offsets


Constructor Summary
Location.DefaultLocationHandle(Context context, int startOffset, int endOffset)
          Constructs a new Location.DefaultLocationHandle
 
Method Summary
 java.lang.Object getClientData()
          Returns the client data associated with this location - an optional field which can be used by the creator of the Location to store temporary state associated with the location.
 Location resolve()
          Compute a full location for the given handle
 void setClientData(java.lang.Object clientData)
          Sets the client data associated with this location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Location.DefaultLocationHandle

public Location.DefaultLocationHandle(@NonNull
                                      Context context,
                                      int startOffset,
                                      int endOffset)
Constructs a new Location.DefaultLocationHandle

Parameters:
context - the context pointing to the file and its contents
startOffset - the start offset within the file
endOffset - the end offset within the file
Method Detail

resolve

@NonNull
public Location resolve()
Description copied from interface: Location.Handle
Compute a full location for the given handle

Specified by:
resolve in interface Location.Handle
Returns:
create a location for this handle

setClientData

public void setClientData(@Nullable
                          java.lang.Object clientData)
Description copied from interface: Location.Handle
Sets the client data associated with this location. This is an optional field which can be used by the creator of the Location to store temporary state associated with the location.

Specified by:
setClientData in interface Location.Handle
Parameters:
clientData - the data to store with this location

getClientData

@Nullable
public java.lang.Object getClientData()
Description copied from interface: Location.Handle
Returns the client data associated with this location - an optional field which can be used by the creator of the Location to store temporary state associated with the location.

Specified by:
getClientData in interface Location.Handle
Returns:
the data associated with this location