Class 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
    • 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 void addResourceConfig​(String element, org.smooks.api.resource.config.ResourceConfig resourceConfig)
      Add the config for the specified element.
      protected void addResourceConfig​(org.smooks.api.resource.config.ResourceConfig config)
      Add the supplied resource configuration to this configuration's main resource configuration list.
      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.
      protected org.smooks.api.delivery.ContentDeliveryConfig buildConfig​(List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings)  
      protected void buildResourceConfigTable​(List<org.smooks.api.resource.config.ResourceConfig> resourceConfigs)
      Build the basic ResourceConfig table from the list.
      protected void extractContentHandlers()
      Extract the ContentHandler instances from the ResourceConfig table and add them to their respective tables.
      protected void fireEvent​(DefaultContentDeliveryConfigBuilder.Event event)  
      protected org.smooks.api.delivery.FilterProvider getFilterProvider()  
      protected String getResourceFilterCharacteristics()
      Logging support function.
      protected void load​(org.smooks.api.profile.ProfileSet profileSet)
      Build the ContentDeliveryConfigBuilder for the specified device.
      protected void logExecutionEvent​(org.smooks.api.resource.config.ResourceConfig resourceConfig, String message)  
      protected void logResourceConfig​(org.smooks.api.profile.ProfileSet profileSet)
      Print a debug log of the resource configurations for the associated profile.
      protected void printHandlerCharacteristics​(org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor> contentHandlerBinding, StringBuffer stringBuf, List<org.smooks.api.delivery.ContentHandler> printedHandlers)  
      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.
    • 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:
        build in interface org.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)