public interface ResourceValue
extends java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
ResourceReference |
asReference() |
java.lang.String |
getLibraryName()
Returns the name of the library where this resource was found or null if it is not from a
library.
|
java.lang.String |
getName() |
ResourceNamespace |
getNamespace() |
ResourceNamespace.Resolver |
getNamespaceResolver() |
default java.lang.String |
getRawXmlValue()
Similar to
getValue(), but returns the raw XML value. |
default ResourceReference |
getReference()
If this
ResourceValue references another one, returns a ResourceReference to
it, otherwise null. |
ResourceType |
getResourceType() |
default ResourceUrl |
getResourceUrl() |
java.lang.String |
getValue()
Returns the value of the resource, as defined in the XML.
|
boolean |
isFramework() |
boolean |
isUserDefined()
Returns true if the resource is user defined.
|
void |
setNamespaceResolver(ResourceNamespace.Resolver resolver)
Specifies logic used to resolve namespace aliases for values that come from XML files.
|
void |
setValue(java.lang.String value)
Sets the value of the resource.
|
@NonNull ResourceType getResourceType()
@NonNull ResourceNamespace getNamespace()
@NonNull java.lang.String getName()
@Nullable java.lang.String getLibraryName()
boolean isUserDefined()
boolean isFramework()
@Nullable java.lang.String getValue()
StyleResourceValue.@NonNull ResourceReference asReference()
@NonNull default ResourceUrl getResourceUrl()
@Nullable default ResourceReference getReference()
ResourceValue references another one, returns a ResourceReference to
it, otherwise null.
This method should be called before inspecting the textual value (getValue()), as
it handles namespaces correctly.
@Nullable default java.lang.String getRawXmlValue()
getValue(), but returns the raw XML value. This is usually the
same as getValue, but with a few exceptions. For example, for markup strings, you can have
<string name="markup">This is <b>bold</b></string>. Here, getValue() will
return "This is bold" -- e.g. just the plain text flattened. However, this method
will return "This is <b>bold</b>", which preserves the XML markup elements.void setValue(@Nullable
java.lang.String value)
value - the new value@NonNull ResourceNamespace.Resolver getNamespaceResolver()
void setNamespaceResolver(@NonNull
ResourceNamespace.Resolver resolver)
This method is meant to be called by the XML parser that created this ResourceValue.