public class ResourceUrl
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
boolean |
create
Whether an id resource is of the form
@+id rather than just @id |
boolean |
framework
If true, the resource is in the android: framework
|
java.lang.String |
name
Name of resource
|
java.lang.String |
namespace
The namespace, or null if it's in the project namespace
|
boolean |
theme
Whether this is a theme resource reference
|
com.android.resources.ResourceType |
type
Type of resource
|
| Modifier and Type | Method and Description |
|---|---|
static ResourceUrl |
create(com.android.resources.ResourceType type,
java.lang.String name,
boolean framework,
boolean create)
Creates a new resource URL.
|
static ResourceUrl |
create(com.android.ide.common.rendering.api.ResourceValue value) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
hasValidName()
Checks whether this resource has a valid name.
|
static boolean |
isNullOrEmpty(java.lang.String url)
Returns if the resource url is @null, @empty or @undefined.
|
static ResourceUrl |
parse(java.lang.String url)
Return the resource type of the given url, and the resource name
|
static ResourceUrl |
parse(java.lang.String url,
boolean forceFramework)
Return the resource type of the given url, and the resource name.
|
java.lang.String |
toString() |
@NonNull public final com.android.resources.ResourceType type
@NonNull public final java.lang.String name
@Nullable public final java.lang.String namespace
public final boolean framework
public final boolean create
@+id rather than just @idpublic final boolean theme
public static ResourceUrl create(@NonNull com.android.resources.ResourceType type, @NonNull java.lang.String name, boolean framework, boolean create)
parse(String).type - the resource typename - the nameframework - whether it's a framework resourcecreate - if it's an id resource, whether it's of the form @+idpublic static ResourceUrl create(@NonNull com.android.ide.common.rendering.api.ResourceValue value)
@Nullable public static ResourceUrl parse(@NonNull java.lang.String url)
url - the resource url to be parsed@Nullable public static ResourceUrl parse(@NonNull java.lang.String url, boolean forceFramework)
url - the resource url to be parsedforceFramework - force the returned value to be a framework resource.public static boolean isNullOrEmpty(@NonNull
java.lang.String url)
public boolean hasValidName()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object