Package org.smooks.engine.delivery
Class DefaultContentDeliveryConfigBuilder
- java.lang.Object
-
- org.smooks.engine.delivery.DefaultContentDeliveryConfigBuilder
-
- All Implemented Interfaces:
org.smooks.api.delivery.ContentDeliveryConfigBuilder
public class DefaultContentDeliveryConfigBuilder extends Object implements org.smooks.api.delivery.ContentDeliveryConfigBuilder
Content delivery configuration builder.- Author:
- tfennelly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultContentDeliveryConfigBuilder.Event
-
Field Summary
Fields Modifier and Type Field Description protected static StringLINE_SEPARATOR
-
Constructor Summary
Constructors Constructor Description DefaultContentDeliveryConfigBuilder(org.smooks.api.profile.ProfileSet profileSet, org.smooks.api.Registry registry, List<org.smooks.api.delivery.FilterProvider> filterProviders)Private (hidden) constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddResourceConfig(String element, org.smooks.api.resource.config.ResourceConfig resourceConfig)Add the config for the specified element.protected voidaddResourceConfig(org.smooks.api.resource.config.ResourceConfig config)Add the supplied resource configuration to this configuration's main resource configuration list.org.smooks.api.delivery.ContentDeliveryConfigbuild(List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings)Get the ContentDeliveryConfig instance for the specified profile set.protected org.smooks.api.delivery.ContentDeliveryConfigbuildConfig(List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings)protected voidbuildResourceConfigTable(List<org.smooks.api.resource.config.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 org.smooks.api.delivery.FilterProvidergetFilterProvider()protected StringgetResourceFilterCharacteristics()Logging support function.protected voidload(org.smooks.api.profile.ProfileSet profileSet)Build the ContentDeliveryConfigBuilder for the specified device.protected voidlogExecutionEvent(org.smooks.api.resource.config.ResourceConfig resourceConfig, String message)protected voidlogResourceConfig(org.smooks.api.profile.ProfileSet profileSet)Print a debug log of the resource configurations for the associated profile.protected voidprintHandlerCharacteristics(org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor> contentHandlerBinding, StringBuffer stringBuf, List<org.smooks.api.delivery.ContentHandler> printedHandlers)protected voidsortResourceConfigs(Map<String,List<org.smooks.api.resource.config.ResourceConfig>> table, org.smooks.api.profile.ProfileSet profileSet)Iterate over the table smooks-resource instances and sort the ResourceConfigs on each element.
-
-
-
Field Detail
-
LINE_SEPARATOR
protected static final String LINE_SEPARATOR
-
-
Constructor Detail
-
DefaultContentDeliveryConfigBuilder
public DefaultContentDeliveryConfigBuilder(org.smooks.api.profile.ProfileSet profileSet, org.smooks.api.Registry registry, List<org.smooks.api.delivery.FilterProvider> filterProviders)Private (hidden) constructor.- Parameters:
profileSet- Profile set.registry- Container context.
-
-
Method Detail
-
build
public org.smooks.api.delivery.ContentDeliveryConfig build(List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings)
Get the ContentDeliveryConfig instance for the specified profile set.- Specified by:
buildin interfaceorg.smooks.api.delivery.ContentDeliveryConfigBuilder- Parameters:
extendedContentHandlerBindings- Preconfigured/extended Visitor Configuration Map.- Returns:
- The ContentDeliveryConfig instance for the named table.
-
buildConfig
protected org.smooks.api.delivery.ContentDeliveryConfig buildConfig(List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings)
-
getFilterProvider
protected org.smooks.api.delivery.FilterProvider getFilterProvider()
-
getResourceFilterCharacteristics
protected String getResourceFilterCharacteristics()
Logging support function.- Returns:
- Verbose characteristics string.
-
printHandlerCharacteristics
protected void printHandlerCharacteristics(org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor> contentHandlerBinding, StringBuffer stringBuf, List<org.smooks.api.delivery.ContentHandler> printedHandlers)
-
load
protected void load(org.smooks.api.profile.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(org.smooks.api.profile.ProfileSet profileSet)
Print a debug log of the resource configurations for the associated profile.
-
buildResourceConfigTable
protected void buildResourceConfigTable(List<org.smooks.api.resource.config.ResourceConfig> resourceConfigs)
Build the basic ResourceConfig table from the list.- Parameters:
resourceConfigs- List of ResourceConfigs.
-
addResourceConfig
protected void addResourceConfig(org.smooks.api.resource.config.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, org.smooks.api.resource.config.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<org.smooks.api.resource.config.ResourceConfig>> table, org.smooks.api.profile.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(org.smooks.api.resource.config.ResourceConfig resourceConfig, String message)
-
fireEvent
protected void fireEvent(DefaultContentDeliveryConfigBuilder.Event event)
-
-