org.apache.wicket.request.resource
Class SharedResourceReference

java.lang.Object
  extended by org.apache.wicket.request.resource.ResourceReference
      extended by org.apache.wicket.request.resource.SharedResourceReference
All Implemented Interfaces:
java.io.Serializable

public class SharedResourceReference
extends ResourceReference

A ResourceReference which should be used to lookup a IResource from the globally registered ones (also known as application shared resources). If there is no shared resource with such key then it checks whether there is a PackageResource with this key and registers it automatically if it exists.

Note: Cannot be registered in ResourceReferenceRegistry because SharedResourceReference is just a shortcut to the resource of another ResourceReference

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.ResourceReference
ResourceReference.Key, ResourceReference.UrlAttributes
 
Constructor Summary
SharedResourceReference(java.lang.Class<?> scope, java.lang.String name)
          Construct.
SharedResourceReference(java.lang.Class<?> scope, java.lang.String name, java.util.Locale locale, java.lang.String style, java.lang.String variation)
          Construct.
SharedResourceReference(java.lang.String name)
          Construct.
 
Method Summary
 boolean canBeRegistered()
          Can be used to disable registering certain resource references in ResourceReferenceRegistry.
 IResource getResource()
          Returns the resource.
 
Methods inherited from class org.apache.wicket.request.resource.ResourceReference
equals, getExtension, getLocale, getName, getScope, getStyle, getUrlAttributes, getVariation, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedResourceReference

public SharedResourceReference(java.lang.Class<?> scope,
                               java.lang.String name,
                               java.util.Locale locale,
                               java.lang.String style,
                               java.lang.String variation)
Construct.

Parameters:
scope - Scope of resource
name - Logical name of resource
locale - The locale of the resource
style - The resource style (see Session)
variation - The component specific variation of the style

SharedResourceReference

public SharedResourceReference(java.lang.Class<?> scope,
                               java.lang.String name)
Construct.

Parameters:
scope - Scope of resource
name - Logical name of resource

SharedResourceReference

public SharedResourceReference(java.lang.String name)
Construct.

Parameters:
name - resource name
Method Detail

getResource

public IResource getResource()
Description copied from class: ResourceReference
Returns the resource.

Specified by:
getResource in class ResourceReference
Returns:
resource instance

canBeRegistered

public boolean canBeRegistered()
Description copied from class: ResourceReference
Can be used to disable registering certain resource references in ResourceReferenceRegistry.

Overrides:
canBeRegistered in class ResourceReference
Returns:
true if this reference can be registered, false otherwise.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.