|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.request.resource.ResourceReference
public abstract class ResourceReference
Reference to a resource. Can be used to reference global resources.
Even though resource reference is just a factory for resources, it still needs to be identified
by a globally unique identifier, combination of scope and name. Those
are used to generate URLs for resource references. locale, style and
variation are optional fields to allow having specific references for individual
locales, styles and variations.
| Nested Class Summary | |
|---|---|
static class |
ResourceReference.Key
A (re-usable) data store for all relevant ResourceReference data |
static class |
ResourceReference.UrlAttributes
|
| Constructor Summary | |
|---|---|
ResourceReference(Class<?> scope,
String name)
Creates new ResourceReference instance. |
|
ResourceReference(Class<?> scope,
String name,
Locale locale,
String style,
String variation)
Creates new ResourceReference instance. |
|
ResourceReference(ResourceReference.Key key)
Creates new ResourceReference instance. |
|
ResourceReference(String name)
Construct. |
|
| Method Summary | |
|---|---|
boolean |
canBeRegistered()
Can be used to disable registering certain resource references in ResourceReferenceRegistry. |
boolean |
equals(Object obj)
|
String |
getExtension()
returns extension of the resource reference |
ResourceReference.Key |
getKey()
|
Locale |
getLocale()
|
String |
getName()
|
abstract IResource |
getResource()
Returns the resource. |
Class<?> |
getScope()
|
String |
getStyle()
|
ResourceReference.UrlAttributes |
getUrlAttributes()
Allows to specify which locale, style and variation values will the generated URL for this resource reference have. |
String |
getVariation()
|
int |
hashCode()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceReference(ResourceReference.Key key)
ResourceReference instance.
key - The data making up the resource reference
public ResourceReference(Class<?> scope,
String name,
Locale locale,
String style,
String variation)
ResourceReference instance.
scope - mandatory parametername - mandatory parameterlocale - resource localestyle - resource stylevariation - resource variation
public ResourceReference(Class<?> scope,
String name)
ResourceReference instance.
scope - mandatory parametername - mandatory parameterpublic ResourceReference(String name)
name - resource name| Method Detail |
|---|
public final ResourceReference.Key getKey()
public String getName()
public final String getExtension()
null if there is no extensionpublic Class<?> getScope()
public Locale getLocale()
public String getStyle()
public String getVariation()
public boolean canBeRegistered()
ResourceReferenceRegistry.
true if this reference can be registered, false otherwise.public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public abstract IResource getResource()
public ResourceReference.UrlAttributes getUrlAttributes()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||