ro.isdc.wro.model.factory
Class ConfigurableModelFactory

java.lang.Object
  extended by ro.isdc.wro.model.resource.support.AbstractConfigurableStrategySupport<S,P>
      extended by ro.isdc.wro.model.resource.support.AbstractConfigurableSingleStrategy<WroModelFactory,ModelFactoryProvider>
          extended by ro.isdc.wro.model.factory.ConfigurableModelFactory
All Implemented Interfaces:
WroModelFactory, ObjectFactory<WroModel>

public class ConfigurableModelFactory
extends AbstractConfigurableSingleStrategy<WroModelFactory,ModelFactoryProvider>
implements WroModelFactory

Since:
1.6.3
Author:
Alex Objelean

Field Summary
static String KEY
          Property name to specify alias.
 
Constructor Summary
ConfigurableModelFactory()
           
 
Method Summary
 WroModel create()
          
 void destroy()
          Called to indicate that the factory is being taken out of service.
protected  WroModelFactory getDefaultStrategy()
          
protected  Class<ModelFactoryProvider> getProviderClass()
           
protected  Map<String,WroModelFactory> getStrategies(ModelFactoryProvider provider)
          
protected  String getStrategyKey()
          
 
Methods inherited from class ro.isdc.wro.model.resource.support.AbstractConfigurableSingleStrategy
getConfiguredStrategy
 
Methods inherited from class ro.isdc.wro.model.resource.support.AbstractConfigurableStrategySupport
copyAll, getAvailableAliases, getAvailableStrategies, getConfiguredValue, getProviderFinder, getStrategyForAlias, newProperties, overrideDefaultStrategyMap, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
Property name to specify alias.

See Also:
Constant Field Values
Constructor Detail

ConfigurableModelFactory

public ConfigurableModelFactory()
Method Detail

getDefaultStrategy

protected WroModelFactory getDefaultStrategy()

Specified by:
getDefaultStrategy in class AbstractConfigurableSingleStrategy<WroModelFactory,ModelFactoryProvider>
Returns:
the default strategy implementation to use when no key is configured is provided.

getStrategies

protected Map<String,WroModelFactory> getStrategies(ModelFactoryProvider provider)

Specified by:
getStrategies in class AbstractConfigurableStrategySupport<WroModelFactory,ModelFactoryProvider>
Parameters:
provider - the instance responsible for strategy lookup.
Returns:
the map of provided strategies.

getProviderClass

protected Class<ModelFactoryProvider> getProviderClass()
Overrides:
getProviderClass in class AbstractConfigurableStrategySupport<WroModelFactory,ModelFactoryProvider>
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.

getStrategyKey

protected String getStrategyKey()

Specified by:
getStrategyKey in class AbstractConfigurableStrategySupport<WroModelFactory,ModelFactoryProvider>
Returns:
the key of the strategy property.

create

public WroModel create()

Specified by:
create in interface ObjectFactory<WroModel>

destroy

public void destroy()
Called to indicate that the factory is being taken out of service.

Specified by:
destroy in interface WroModelFactory


Copyright © 2008-2013. All Rights Reserved.