ro.isdc.wro.model.resource.processor.factory
Class ConfigurableProcessorsFactory

java.lang.Object
  extended by ro.isdc.wro.model.resource.processor.factory.ConfigurableProcessorsFactory
All Implemented Interfaces:
ProcessorsFactory

public class ConfigurableProcessorsFactory
extends Object
implements ProcessorsFactory

A ProcessorsFactory implementation which is easy to configure using a Properties object.

Since:
1.4.0
Author:
Alex Objelean

Field Summary
static String PARAM_POST_PROCESSORS
          Property name to specify post processors.
static String PARAM_PRE_PROCESSORS
          Property name to specify pre processors.
 
Constructor Summary
ConfigurableProcessorsFactory()
           
 
Method Summary
 Collection<ResourcePostProcessor> getPostProcessors()
          
protected  Map<String,ResourcePostProcessor> getPostProcessorStrategies(ProcessorProvider provider)
           
 Collection<ResourcePreProcessor> getPreProcessors()
          
protected  Map<String,ResourcePreProcessor> getPreProcessorStrategies(ProcessorProvider provider)
           
protected  Map<String,ResourcePostProcessor> newPostProcessorsMap()
          By default the processor will be discovered using ServiceRegistry pattern (by inspecting META-INF/services folder of each dependency).
protected  Map<String,ResourcePreProcessor> newPreProcessorsMap()
          By default the processor will be discovered using ServiceRegistry pattern (by inspecting META-INF/services folder of each dependency).
protected  Properties newProperties()
           
 ConfigurableProcessorsFactory setPostProcessorsMap(Map<String,ResourcePostProcessor> map)
           
 ConfigurableProcessorsFactory setPreProcessorsMap(Map<String,ResourcePreProcessor> map)
           
 ConfigurableProcessorsFactory setProperties(Properties properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_PRE_PROCESSORS

public static final String PARAM_PRE_PROCESSORS
Property name to specify pre processors.

See Also:
Constant Field Values

PARAM_POST_PROCESSORS

public static final String PARAM_POST_PROCESSORS
Property name to specify post processors.

See Also:
Constant Field Values
Constructor Detail

ConfigurableProcessorsFactory

public ConfigurableProcessorsFactory()
Method Detail

newProperties

protected Properties newProperties()
Returns:
default implementation of Properties containing the list of pre & post processors.

getPreProcessors

public final Collection<ResourcePreProcessor> getPreProcessors()

Specified by:
getPreProcessors in interface ProcessorsFactory
Returns:
a collection of pre processors to apply.

getPostProcessors

public final Collection<ResourcePostProcessor> getPostProcessors()

Specified by:
getPostProcessors in interface ProcessorsFactory
Returns:
a collection of post processors to apply.

setPreProcessorsMap

public ConfigurableProcessorsFactory setPreProcessorsMap(Map<String,ResourcePreProcessor> map)
Parameters:
map - containing preProcessors with corresponding alias (as key). The map must not be null and once set, the default map will be overridden.

setPostProcessorsMap

public ConfigurableProcessorsFactory setPostProcessorsMap(Map<String,ResourcePostProcessor> map)
Parameters:
map - containing postProcessors with corresponding alias (as key). The map must not be null and once set, the default map will be overridden.

setProperties

public ConfigurableProcessorsFactory setProperties(Properties properties)

newPreProcessorsMap

protected Map<String,ResourcePreProcessor> newPreProcessorsMap()
By default the processor will be discovered using ServiceRegistry pattern (by inspecting META-INF/services folder of each dependency).

Returns:
a default map of preProcessors.

newPostProcessorsMap

protected Map<String,ResourcePostProcessor> newPostProcessorsMap()
By default the processor will be discovered using ServiceRegistry pattern (by inspecting META-INF/services folder of each dependency).

Returns:
a default map of postProcessors.

getPostProcessorStrategies

protected Map<String,ResourcePostProcessor> getPostProcessorStrategies(ProcessorProvider provider)

getPreProcessorStrategies

protected Map<String,ResourcePreProcessor> getPreProcessorStrategies(ProcessorProvider provider)


Copyright © 2008-2013. All Rights Reserved.