ro.isdc.wro.model.resource.locator.factory
Class ConfigurableLocatorFactory
java.lang.Object
ro.isdc.wro.model.resource.support.AbstractConfigurableStrategySupport<S,P>
ro.isdc.wro.model.resource.support.AbstractConfigurableMultipleStrategy<UriLocator,LocatorProvider>
ro.isdc.wro.model.resource.locator.factory.ConfigurableLocatorFactory
- All Implemented Interfaces:
- UriLocatorFactory
public class ConfigurableLocatorFactory
- extends AbstractConfigurableMultipleStrategy<UriLocator,LocatorProvider>
- implements UriLocatorFactory
A ProcessorsFactory
implementation which is easy to configure using a Properties
object.
- Since:
- 1.4.0
- Author:
- Alex Objelean
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PARAM_URI_LOCATORS
public static final String PARAM_URI_LOCATORS
- Name of init param used to specify uri locators.
- See Also:
- Constant Field Values
ConfigurableLocatorFactory
public ConfigurableLocatorFactory()
getStrategyKey
protected String getStrategyKey()
-
- Specified by:
getStrategyKey
in class AbstractConfigurableStrategySupport<UriLocator,LocatorProvider>
- Returns:
- the key of the strategy property.
getStrategies
protected Map<String,UriLocator> getStrategies(LocatorProvider provider)
-
- Specified by:
getStrategies
in class AbstractConfigurableStrategySupport<UriLocator,LocatorProvider>
- Parameters:
provider
- the instance responsible for strategy lookup.
- Returns:
- the map of provided strategies.
locate
public InputStream locate(String uri)
throws IOException
- Locates an InputStream for the given uri.
- Specified by:
locate
in interface UriLocatorFactory
- Parameters:
uri
- to locate.
- Returns:
InputStream
of the resource.
- Throws:
IOException
- if uri is invalid or resource couldn't be located.
getInstance
public UriLocator getInstance(String uri)
-
- Specified by:
getInstance
in interface UriLocatorFactory
- Parameters:
uri
- to handle by the locator.
- Returns:
- an instance of
UriLocator
which is capable of handling provided uri. Returns null if no locator
found.
getProviderClass
protected Class<LocatorProvider> getProviderClass()
-
- Overrides:
getProviderClass
in class AbstractConfigurableStrategySupport<UriLocator,LocatorProvider>
- Returns:
- the class of the provider of type P. Uses
ParameterizedType
to compute the class. Override it to
support anonymous classes which do not play well with ParameterizedType
's.
Copyright © 2008-2013. All Rights Reserved.