org.apache.wicket.request.resource
Class JavaScriptPackageResource

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

public class JavaScriptPackageResource
extends PackageResource

Package resource for javascript files. It strips comments and whitespace from javascript.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.PackageResource
PackageResource.PackageResourceBlockedException
 
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
 
Field Summary
 
Fields inherited from class org.apache.wicket.request.resource.AbstractResource
INTERNAL_HEADERS
 
Constructor Summary
JavaScriptPackageResource(java.lang.Class<?> scope, java.lang.String name, java.util.Locale locale, java.lang.String style, java.lang.String variation)
          Construct.
 
Method Summary
protected  IJavaScriptCompressor getCompressor()
          Gets the IJavaScriptCompressor to be used.
protected  byte[] processResponse(IResource.Attributes attributes, byte[] bytes)
          Gives a chance to modify the resource going to be written in the response
 
Methods inherited from class org.apache.wicket.request.resource.PackageResource
equals, exists, getCacheableResourceStream, getCacheKey, getResourceStream, getScope, getStyle, hashCode, newResourceResponse, toString
 
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setResponseHeaders
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.request.resource.IResource
respond
 

Constructor Detail

JavaScriptPackageResource

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

Parameters:
scope -
name -
locale -
style -
variation -
Method Detail

processResponse

protected byte[] processResponse(IResource.Attributes attributes,
                                 byte[] bytes)
Description copied from class: PackageResource
Gives a chance to modify the resource going to be written in the response

Overrides:
processResponse in class PackageResource
Parameters:
attributes - current request attributes from client
bytes - the original response
Returns:
the processed response

getCompressor

protected IJavaScriptCompressor getCompressor()
Gets the IJavaScriptCompressor to be used. By default returns the configured compressor on application level, but can be overriden by the user application to provide compressor specific to the resource.

Returns:
the configured application level JavaScript compressor. May be null.


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