org.apache.wicket.request.resource
Class PackageResource

java.lang.Object
  extended by org.apache.wicket.request.resource.AbstractResource
      extended by org.apache.wicket.request.resource.PackageResource
All Implemented Interfaces:
Serializable, IResource

public class PackageResource
extends AbstractResource

See Also:
Serialized Form

Nested Class Summary
static class PackageResource.PackageResourceBlockedException
          Exception thrown when the creation of a package resource is not allowed.
 
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
AbstractResource.ResourceResponse, AbstractResource.WriteCallback
 
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
IResource.Attributes
 
Constructor Summary
protected PackageResource(Class<?> scope, String name, Locale locale, String style, String variation)
          Hidden constructor.
 
Method Summary
static boolean exists(Class<?> scope, String path, Locale locale, String style, String variation)
          Gets whether a resource for a given set of criteria exists.
 Class<?> getScope()
          Gets the scoping class, used for class loading and to determine the package.
 String getStyle()
          Gets the style.
protected  AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
          creates a new resource response based on the request attributes
 
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, respond
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageResource

protected PackageResource(Class<?> scope,
                          String name,
                          Locale locale,
                          String style,
                          String variation)
Hidden constructor.

Parameters:
scope - This argument will be used to get the class loader for loading the package resource, and to determine what package it is in
name - The relative path to the resource
locale - The locale of the resource
style - The style of the resource
variation - The component's variation (of the style)
Method Detail

getScope

public final Class<?> getScope()
Gets the scoping class, used for class loading and to determine the package.

Returns:
the scoping class

getStyle

public final String getStyle()
Gets the style.

Returns:
the style

newResourceResponse

protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
creates a new resource response based on the request attributes

Specified by:
newResourceResponse in class AbstractResource
Parameters:
attributes - current request attributes from client
Returns:
resource response for answering request

exists

public static boolean exists(Class<?> scope,
                             String path,
                             Locale locale,
                             String style,
                             String variation)
Gets whether a resource for a given set of criteria exists.

Parameters:
scope - This argument will be used to get the class loader for loading the package resource, and to determine what package it is in. Typically this is the class in which you call this method
path - The path to the resource
locale - The locale of the resource
style - The style of the resource (see Session)
variation - The component's variation (of the style)
Returns:
true if a resource could be loaded, false otherwise


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.