|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.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:
Constructor Summary | |
---|---|
ResourceStreamLocator()
Constructor |
|
ResourceStreamLocator(IResourceFinder finder)
Constructor |
Method Summary | |
---|---|
List<String> |
getClasspathLocationPrefixes()
The list of prefixes that are added to a path when trying to find resources in the classpath. |
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. |
protected IResourceStream |
locateByClassLoader(Class<?> clazz,
String path)
Search the the resource my means of the various classloaders available |
protected IResourceStream |
locateByResourceFinder(Class<?> clazz,
String path)
Search the resource by means of the application registered resource finder |
ResourceNameIterator |
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 finder)
finder
- resource finderMethod Detail |
---|
public IResourceStream locate(Class<?> clazz, String path)
IResourceStreamLocator
#locate(Class, String, String, Locale, String)
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)
protected IResourceStream locateByClassLoader(Class<?> clazz, String path)
clazz
- path
-
protected IResourceStream locateByResourceFinder(Class<?> clazz, String path)
clazz
- path
-
public ResourceNameIterator 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 List<String> getClasspathLocationPrefixes()
""
- no prefix"META-INF/resources"
- for Servlet 3.0 compatibility.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |