|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.core.util.resource.locator.ResourceStreamLocator
public class ResourceStreamLocator
Locate Wicket resource.
Contains the logic to locate a resource based on a path, a style (see
Session
), a locale and an extension string. The full filename will be
built like: <path>_<style>_<locale>.<extension>.
Resource matches will be attempted in the following order:
Locales may contain a language, a country and a region or variant. Combinations of these components will be attempted in the following order:
Resources will be actually loaded by the IResourceFinder
s defined in the resource
settings. By default there are finders that look in the classpath and in the classpath in
META-INF/resources. You can add more by adding WebApplicationPath
s or Path
s to
IResourceSettings.getResourceFinders()
.
Constructor Summary | |
---|---|
ResourceStreamLocator()
Constructor |
|
ResourceStreamLocator(IResourceFinder... finders)
Constructor |
|
ResourceStreamLocator(List<IResourceFinder> finders)
Constructor |
Method Summary | |
---|---|
IResourceStream |
locate(Class<?> clazz,
String path)
Locate a resource, given a path and class. |
IResourceStream |
locate(Class<?> clazz,
String path,
String style,
String variation,
Locale locale,
String extension,
boolean strict)
Locate a resource by combining the given path, style, variation, locale and extension parameters. |
IResourceNameIterator |
newResourceNameIterator(String path,
Locale locale,
String style,
String variation,
Iterable<String> extensions,
boolean strict)
|
IResourceNameIterator |
newResourceNameIterator(String path,
Locale locale,
String style,
String variation,
String extension,
boolean strict)
Markup resources and Properties files both need to iterate over different combinations of locale, style, etc.. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceStreamLocator()
public ResourceStreamLocator(IResourceFinder... finders)
finders
- resource finders. These will be tried in the given order.public ResourceStreamLocator(List<IResourceFinder> finders)
finders
- resource finders. These will be tried in the given order.Method Detail |
---|
public IResourceStream locate(Class<?> clazz, String path)
IResourceStreamLocator
IResourceStreamLocator.locate(Class, String, String, String, java.util.Locale, String, boolean)
where the
latter just takes care of trying out the different combinations for the provided style and
locale and uses this method to actually load the resource stream.
locate
in interface IResourceStreamLocator
clazz
- The class loader for delegating the loading of the resourcepath
- The path of the resource
IResourceStreamLocator.locate(java.lang.Class,
java.lang.String)
public IResourceStream locate(Class<?> clazz, String path, String style, String variation, Locale locale, String extension, boolean strict)
IResourceStreamLocator
locate
in interface IResourceStreamLocator
clazz
- The class loader for delegating the loading of the resourcepath
- The path of the resourcestyle
- Any resource style, such as a skin style (see Session
)variation
- The component's variation (of the style)locale
- The locale of the resource to loadextension
- A comma separate list of extensionsstrict
- whether the specified attributes must match exactly
IResourceStreamLocator.locate(java.lang.Class,
java.lang.String, java.lang.String, java.lang.String, java.util.Locale,
java.lang.String, boolean)
public IResourceNameIterator newResourceNameIterator(String path, Locale locale, String style, String variation, String extension, boolean strict)
IResourceStreamLocator
newResourceNameIterator
in interface IResourceStreamLocator
path
- The path of the resourcelocale
- The locale of the resource to loadstyle
- Any resource style, such as a skin style (see Session
)variation
- The component's variation (of the style)extension
- A comma separate list of extensionsstrict
- whether the specified attributes must match exactly
IResourceStreamLocator.newResourceNameIterator(java.lang.String,
java.util.Locale, java.lang.String, java.lang.String, java.lang.String, boolean)
public IResourceNameIterator newResourceNameIterator(String path, Locale locale, String style, String variation, Iterable<String> extensions, boolean strict)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |