|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.isdc.wro.model.resource.support.AbstractConfigurableStrategySupport<S,P>
S
- strategy typeP
- provider typepublic abstract class AbstractConfigurableStrategySupport<S,P>
Abstracts the configurable creation of the strategies based on ProviderFinder
. Uses two generic parameters:
Constructor Summary | |
---|---|
AbstractConfigurableStrategySupport()
|
Method Summary | |
---|---|
protected void |
copyAll(Map<String,S> source,
Map<String,S> target)
Utility method which copies all entries from source into target. |
Set<String> |
getAvailableAliases()
|
Collection<S> |
getAvailableStrategies()
|
protected String |
getConfiguredValue()
|
protected Class<P> |
getProviderClass()
|
protected ProviderFinder<P> |
getProviderFinder()
|
protected abstract Map<String,S> |
getStrategies(P provider)
|
protected S |
getStrategyForAlias(String alias)
Override this method if a fallback search is required. |
protected abstract String |
getStrategyKey()
|
protected Properties |
newProperties()
|
protected void |
overrideDefaultStrategyMap(Map<String,S> map)
Invoked after the the map of strategies is built from providers. |
void |
setProperties(Properties props)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractConfigurableStrategySupport()
Method Detail |
---|
protected S getStrategyForAlias(String alias)
alias
- of the strategy to use.
protected final String getConfiguredValue()
public final Set<String> getAvailableAliases()
public final Collection<S> getAvailableStrategies()
protected void overrideDefaultStrategyMap(Map<String,S> map)
map
- the built map.protected final void copyAll(Map<String,S> source, Map<String,S> target)
Map.putAll(Map)
, but it doesn't require
changing generics to construction like
extends String, ? extends S>
source
- the map from where the entries will be copied into target.target
- the map where to put entries from source.protected Properties newProperties()
Properties
used to lookup namingStrategy alias.public final void setProperties(Properties props)
props
- Properties
containing configured alias.protected ProviderFinder<P> getProviderFinder()
ProviderFinder
used to find all strategies.protected Class<P> getProviderClass()
ParameterizedType
to compute the class. Override it to
support anonymous classes which do not play well with ParameterizedType
's.protected abstract Map<String,S> getStrategies(P provider)
provider
- the instance responsible for strategy lookup.
protected abstract String getStrategyKey()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |