Module org.apache.wicket.core
Interface IResourceStreamLocator
- All Known Implementing Classes:
CachingResourceStreamLocator
,OsgiResourceStreamLocator
,ResourceStreamLocator
public interface IResourceStreamLocator
Interface for code that locates resources, taking into account variations for locale and style.
- Author:
- Jonathan Locke
-
Method Summary
Modifier and TypeMethodDescriptionLocate a resource, given a path and class.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.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..
-
Method Details
-
locate
Locate a resource, given a path and class. Typically this method is either called by external clients if they are not interested in a lookup that takes the style and locale into account, or it is called by the implementation oflocate(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.- Parameters:
clazz
- The class loader for delegating the loading of the resourcepath
- The path of the resource- Returns:
- The resource or null
-
locate
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. The exact search order depends on the implementation.- Parameters:
clazz
- The class loader for delegating the loading of the resourcepath
- The path of the resourcestyle
- Any resource style, such as a skin style (seeSession
)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- Returns:
- The resource or null
-
newResourceNameIterator
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.. And though no single locate(..) method exists which is used by both, they both use ResourceNameIterators.- Parameters:
path
- The path of the resourcestyle
- Any resource style, such as a skin style (seeSession
)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- Returns:
- resource name iterator
-