Package org.smooks.engine.delivery
Class DefaultContentDeliveryConfigBuilder
- java.lang.Object
-
- org.smooks.engine.delivery.DefaultContentDeliveryConfigBuilder
-
- All Implemented Interfaces:
ContentDeliveryConfigBuilder
public class DefaultContentDeliveryConfigBuilder extends Object implements ContentDeliveryConfigBuilder
Content delivery configuration builder.- Author:
- tfennelly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultContentDeliveryConfigBuilder.Event
-
Constructor Summary
Constructors Constructor Description DefaultContentDeliveryConfigBuilder(ProfileSet profileSet, Registry registry, List<FilterProvider> filterProviders)Private (hidden) constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddResourceConfig(String element, ResourceConfig resourceConfig)Add the config for the specified element.protected voidaddResourceConfig(ResourceConfig config)Add the supplied resource configuration to this configuration's main resource configuration list.ContentDeliveryConfigbuild(List<ContentHandlerBinding<Visitor>> extendedContentHandlerBindings)Get the ContentDeliveryConfig instance for the specified profile set.protected ContentDeliveryConfigbuildConfig(List<ContentHandlerBinding<Visitor>> extendedContentHandlerBindings)protected voidbuildResourceConfigTable(List<ResourceConfig> resourceConfigs)Build the basic ResourceConfig table from the list.protected voidextractContentHandlers()Extract the ContentHandler instances from the ResourceConfig table and add them to their respective tables.protected voidfireEvent(DefaultContentDeliveryConfigBuilder.Event event)protected FilterProvidergetFilterProvider()protected StringgetResourceFilterCharacteristics()Logging support function.protected voidload(ProfileSet profileSet)Build the ContentDeliveryConfigBuilder for the specified device.protected voidlogExecutionEvent(ResourceConfig resourceConfig, String message)protected voidlogResourceConfig(ProfileSet profileSet)Print a debug log of the resource configurations for the associated profile.protected voidprintHandlerCharacteristics(ContentHandlerBinding<Visitor> contentHandlerBinding, StringBuffer stringBuf, List<ContentHandler> printedHandlers)protected voidsortResourceConfigs(Map<String,List<ResourceConfig>> table, ProfileSet profileSet)Iterate over the table smooks-resource instances and sort the ResourceConfigs on each element.
-
-
-
Constructor Detail
-
DefaultContentDeliveryConfigBuilder
public DefaultContentDeliveryConfigBuilder(ProfileSet profileSet, Registry registry, List<FilterProvider> filterProviders)
Private (hidden) constructor.- Parameters:
profileSet- Profile set.registry- Container context.
-
-
Method Detail
-
build
public ContentDeliveryConfig build(List<ContentHandlerBinding<Visitor>> extendedContentHandlerBindings)
Get the ContentDeliveryConfig instance for the specified profile set.- Specified by:
buildin interfaceContentDeliveryConfigBuilder- Parameters:
extendedContentHandlerBindings- Preconfigured/extended Visitor Configuration Map.- Returns:
- The ContentDeliveryConfig instance for the named table.
-
buildConfig
protected ContentDeliveryConfig buildConfig(List<ContentHandlerBinding<Visitor>> extendedContentHandlerBindings)
-
getFilterProvider
protected FilterProvider getFilterProvider()
-
getResourceFilterCharacteristics
protected String getResourceFilterCharacteristics()
Logging support function.- Returns:
- Verbose characteristics string.
-
printHandlerCharacteristics
protected void printHandlerCharacteristics(ContentHandlerBinding<Visitor> contentHandlerBinding, StringBuffer stringBuf, List<ContentHandler> printedHandlers)
-
load
protected void load(ProfileSet profileSet)
Build the ContentDeliveryConfigBuilder for the specified device. Creates the buildTable instance and populates it with the ProcessingUnit matrix for the specified device.
-
logResourceConfig
protected void logResourceConfig(ProfileSet profileSet)
Print a debug log of the resource configurations for the associated profile.
-
buildResourceConfigTable
protected void buildResourceConfigTable(List<ResourceConfig> resourceConfigs)
Build the basic ResourceConfig table from the list.- Parameters:
resourceConfigs- List of ResourceConfigs.
-
addResourceConfig
protected void addResourceConfig(ResourceConfig config)
Add the supplied resource configuration to this configuration's main resource configuration list.- Parameters:
config- The configuration to be added.
-
addResourceConfig
protected void addResourceConfig(String element, ResourceConfig resourceConfig)
Add the config for the specified element.- Parameters:
element- The element to which the config is to be added.resourceConfig- The Object to be added.
-
sortResourceConfigs
protected void sortResourceConfigs(Map<String,List<ResourceConfig>> table, ProfileSet profileSet)
Iterate over the table smooks-resource instances and sort the ResourceConfigs on each element. Ordered by specificity.
-
extractContentHandlers
protected void extractContentHandlers()
Extract the ContentHandler instances from the ResourceConfig table and add them to their respective tables.
-
logExecutionEvent
protected void logExecutionEvent(ResourceConfig resourceConfig, String message)
-
fireEvent
protected void fireEvent(DefaultContentDeliveryConfigBuilder.Event event)
-
-