ro.isdc.wro.model.resource.support.naming
Class ConfigurableNamingStrategy
java.lang.Object
ro.isdc.wro.model.resource.support.AbstractConfigurableStrategySupport<S,P>
ro.isdc.wro.model.resource.support.AbstractConfigurableSingleStrategy<NamingStrategy,NamingStrategyProvider>
ro.isdc.wro.model.resource.support.naming.ConfigurableNamingStrategy
- All Implemented Interfaces:
- NamingStrategy
public class ConfigurableNamingStrategy
- extends AbstractConfigurableSingleStrategy<NamingStrategy,NamingStrategyProvider>
- implements NamingStrategy
Uses the NamingStrategy
implementation associated with an alias read from properties file.
- Since:
- 1.4.7
- Author:
- Alex Objelean
Field Summary |
static String |
KEY
Property name to specify namingStrategy alias. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY
public static final String KEY
- Property name to specify namingStrategy alias.
- See Also:
- Constant Field Values
ConfigurableNamingStrategy
public ConfigurableNamingStrategy()
rename
public String rename(String originalName,
InputStream inputStream)
throws IOException
- Creates a new name of the resource which encodes a version.
- Specified by:
rename
in interface NamingStrategy
- Parameters:
originalName
- original name of the resource.inputStream
- the stream of the content to rename.
- Returns:
- new name of the resource with version encoded.
- Throws:
IOException
- if there are stream reading problem.
getDefaultStrategy
protected NamingStrategy getDefaultStrategy()
-
- Specified by:
getDefaultStrategy
in class AbstractConfigurableSingleStrategy<NamingStrategy,NamingStrategyProvider>
- Returns:
- the default strategy implementation to use when no key is configured is provided.
getStrategies
protected Map<String,NamingStrategy> getStrategies(NamingStrategyProvider provider)
-
- Specified by:
getStrategies
in class AbstractConfigurableStrategySupport<NamingStrategy,NamingStrategyProvider>
- Parameters:
provider
- the instance responsible for strategy lookup.
- Returns:
- the map of provided strategies.
getStrategyKey
protected String getStrategyKey()
-
- Specified by:
getStrategyKey
in class AbstractConfigurableStrategySupport<NamingStrategy,NamingStrategyProvider>
- Returns:
- the key of the strategy property.
getProviderClass
protected Class<NamingStrategyProvider> getProviderClass()
-
- Overrides:
getProviderClass
in class AbstractConfigurableStrategySupport<NamingStrategy,NamingStrategyProvider>
- 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.