public class ResourceBundles extends Object
Constructor and Description |
---|
ResourceBundles(ResourceReferenceRegistry registry)
Construct.
|
Modifier and Type | Method and Description |
---|---|
<T extends HeaderItem> |
addBundle(T bundle)
Adds a bundle to the registry.
|
CssReferenceHeaderItem |
addCssBundle(Class<?> scope,
String name,
CssResourceReference... references)
Adds a css bundle that is automatically generated by concatenating the given package
resources.
|
JavaScriptReferenceHeaderItem |
addJavaScriptBundle(Class<?> scope,
String name,
boolean defer,
JavaScriptResourceReference... references)
Adds a javascript bundle that is automatically generated by concatenating the given package
resources.
|
JavaScriptReferenceHeaderItem |
addJavaScriptBundle(Class<?> scope,
String name,
JavaScriptResourceReference... references)
Adds a javascript bundle that is automatically generated by concatenating the given package
resources.
|
HeaderItem |
findBundle(HeaderItem item)
Finds a bundle that provides the given item.
|
protected <T extends HeaderItem & IReferenceHeaderItem> |
newBundleResourceReference(Class<?> scope,
String name,
List<T> items)
Creates a ResourceReference that will point to the bundle with the items
|
public ResourceBundles(ResourceReferenceRegistry registry)
registry
- the registry that keeps all referenced resourcespublic JavaScriptReferenceHeaderItem addJavaScriptBundle(Class<?> scope, String name, JavaScriptResourceReference... references)
addBundle(HeaderItem)
with a
JavaScriptHeaderItem
for a ConcatResourceBundleReference
.scope
- The scope of the bundlename
- The name of the resource. This will show up as the filename in the markup.references
- The resources this bundle will consist of.public JavaScriptReferenceHeaderItem addJavaScriptBundle(Class<?> scope, String name, boolean defer, JavaScriptResourceReference... references)
addBundle(HeaderItem)
with a
JavaScriptHeaderItem
for a ConcatResourceBundleReference
.scope
- The scope of the bundledefer
- specifies that the execution of a script should be deferred (delayed) until after
the page has been loaded.name
- The name of the resource. This will show up as the filename in the markup.references
- The resources this bundle will consist of.public CssReferenceHeaderItem addCssBundle(Class<?> scope, String name, CssResourceReference... references)
addBundle(HeaderItem)
with a CssHeaderItem
for
a ConcatResourceBundleReference
.scope
- The scope of the bundlename
- The name of the resource. This will show up as the filename in the markup.references
- The resources this bundle will consist of.protected <T extends HeaderItem & IReferenceHeaderItem> ConcatResourceBundleReference<T> newBundleResourceReference(Class<?> scope, String name, List<T> items)
T
- The type of the header itemsscope
- The scope of the bundlename
- The name of the resource. This will show up as the filename in the markup.items
- The HeaderItems for the resource references for the bundlepublic <T extends HeaderItem> T addBundle(T bundle)
bundle
- The bundle to registerIllegalArgumentException
- if any of the provided resources of the given bundle is already provided by a
different bundle.public HeaderItem findBundle(HeaderItem item)
item
- The item that should be provided by the bundle.Copyright © 2006–2022 Apache Software Foundation. All rights reserved.