public static class ResourceUsageModel.Resource extends java.lang.Object implements java.lang.Comparable<ResourceUsageModel.Resource>
Modifier and Type | Field and Description |
---|---|
java.util.List<java.io.File> |
declarations |
com.android.tools.lint.detector.api.Location |
locations
Chained list of declaration locations
|
java.lang.String |
name
Name of resource
|
java.util.List<ResourceUsageModel.Resource> |
references
Resources this resource references.
|
com.android.resources.ResourceType |
type
Type of resource
|
int |
value
Integer id location
|
Constructor and Description |
---|
Resource(com.android.resources.ResourceType type,
java.lang.String name,
int value) |
Modifier and Type | Method and Description |
---|---|
void |
addLocation(java.io.File file) |
void |
addReference(ResourceUsageModel.Resource resource) |
int |
compareTo(ResourceUsageModel.Resource other) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getField() |
java.lang.String |
getUrl() |
int |
hashCode() |
boolean |
isDeclared()
Whether we found a declaration for this resource (otherwise we might have seen
a reference to this before we came across its potential declaration, so we added it
to the map, but we don't want to report unused resources for invalid resource
references
|
boolean |
isDiscard()
This resource is marked as to be ignored for usage analysis, regardless of lack of
references
|
boolean |
isKeep()
This resource is marked as to be ignored for usage analysis, regardless of
references
|
boolean |
isPublic()
This resource is marked as public
|
boolean |
isReachable() |
void |
recordLocation(com.android.tools.lint.detector.api.Location location) |
void |
setDeclared(boolean on)
Whether we found a declaration for this resource (otherwise we might have seen
a reference to this before we came across its potential declaration, so we added it
to the map, but we don't want to report unused resources for invalid resource
references
|
void |
setDiscard(boolean on)
This resource is marked as to be ignored for usage analysis, regardless of lack of
references
|
void |
setKeep(boolean on)
This resource is marked as to be ignored for usage analysis, regardless of
references
|
void |
setPublic(boolean on)
This resource is marked as public
|
void |
setReachable(boolean on) |
java.lang.String |
toString() |
public final com.android.resources.ResourceType type
public final java.lang.String name
public int value
public java.util.List<ResourceUsageModel.Resource> references
public com.android.tools.lint.detector.api.Location locations
public java.util.List<java.io.File> declarations
public Resource(com.android.resources.ResourceType type, java.lang.String name, int value)
public boolean isDeclared()
public void setDeclared(boolean on)
public boolean isPublic()
public void setPublic(boolean on)
public boolean isKeep()
public void setKeep(boolean on)
public boolean isDiscard()
public void setDiscard(boolean on)
public boolean isReachable()
public void setReachable(boolean on)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void addLocation(@NonNull java.io.File file)
public void recordLocation(@NonNull com.android.tools.lint.detector.api.Location location)
public void addReference(@Nullable ResourceUsageModel.Resource resource)
public java.lang.String getUrl()
public java.lang.String getField()
public int compareTo(@NonNull ResourceUsageModel.Resource other)
compareTo
in interface java.lang.Comparable<ResourceUsageModel.Resource>