Class PackageResourceReference
java.lang.Object
org.apache.wicket.request.resource.ResourceReference
org.apache.wicket.request.resource.PackageResourceReference
- All Implemented Interfaces:
Serializable
,IClusterable
- Direct Known Subclasses:
CssResourceReference
,JavaScriptResourceReference
,MetaInfStaticResourceReference
This is a ResourceReference that knows how to find and serve resources located in the Java
package (i.e. next to the class files).
- Author:
- Tobias Soloschenko
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.ResourceReference
ResourceReference.Key, ResourceReference.LambdaResourceReference, ResourceReference.UrlAttributes
-
Constructor Summary
ConstructorDescriptionPackageResourceReference
(Class<?> scope, String name) Construct.PackageResourceReference
(Class<?> scope, String name, Locale locale, String style, String variation) Construct.Construct.Construct. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns the resource.Allows to specify which locale, style and variation values will the generated URL for this resource reference have.readBuffered
(boolean readBuffered) If the package resource should be read buffered.
WARNING - if the stream is not read buffered compressors will not work, because they require the whole content to be read into memory.
(IJavaScriptCompressor
,
ICssCompressor
,
IScopeAwareTextResourceProcessor
)protected final void
Method allowing to remove the compress flag if the resource has been detected as a minified one (i.e.Methods inherited from class org.apache.wicket.request.resource.ResourceReference
canBeRegistered, equals, getDependencies, getExtension, getKey, getLocale, getName, getScope, getStyle, getVariation, hashCode, of, of, toString
-
Constructor Details
-
PackageResourceReference
Construct.- Parameters:
key
-
-
PackageResourceReference
public PackageResourceReference(Class<?> scope, String name, Locale locale, String style, String variation) Construct.- Parameters:
scope
-name
-locale
-style
-variation
-
-
PackageResourceReference
Construct.- Parameters:
scope
-name
-
-
PackageResourceReference
Construct.- Parameters:
name
-
-
-
Method Details
-
getResource
Description copied from class:ResourceReference
Returns the resource.- Specified by:
getResource
in classResourceReference
- Returns:
- resource instance
- See Also:
-
removeCompressFlagIfUnnecessary
Method allowing to remove the compress flag if the resource has been detected as a minified one (i.e. ending with .min.EXT) This method is to be called by subclasses overridinggetResource
if they want to rely on default minification detection handling see WICKET-5250 for further explanation- Parameters:
resource
- resource to check
-
getMinifiedName
- Returns:
- How the minified file should be named.
-
getUrlAttributes
Description copied from class:ResourceReference
Allows to specify which locale, style and variation values will the generated URL for this resource reference have.- Overrides:
getUrlAttributes
in classResourceReference
- Returns:
- url attributes
-
readBuffered
If the package resource should be read buffered.
WARNING - if the stream is not read buffered compressors will not work, because they require the whole content to be read into memory.
(IJavaScriptCompressor
,
ICssCompressor
,
IScopeAwareTextResourceProcessor
)- Parameters:
readBuffered
- if the package resource should be read buffered- Returns:
- the current package resource
-