Class CmsFormatterChangeSet


  • public class CmsFormatterChangeSet
    extends java.lang.Object
    This class represents the changes which can be made to formatters in a sitemap configuration file.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PREFIX_TYPE
      The prefix used for types in the Add/RemoveFormatter fields in the configuration.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsFormatterChangeSet()
      Creates an empty formatter change set.
      CmsFormatterChangeSet​(java.util.Collection<java.lang.String> toRemove, java.util.Collection<java.lang.String> toAdd, java.lang.String siteRoot, boolean removeAllNonExplicitlyAdded, boolean removeFunctions, java.util.Set<CmsUUID> functions, java.util.Set<CmsUUID> functionsToRemove)
      Creates a new formatter change set.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void applyToFormatters​(CmsFormatterIndex formatterIndex, CmsFormatterConfigurationCacheState externalFormatters)
      Applies this change set to a list of external (non schema-based) formatters.
      void applyToTypes​(java.util.Set<java.lang.String> types)
      Applies the changes (addition or removal of schema formatters) to a set of resource type names, adding resource types for which schema formatters should be added and removing those for which schema formatters should be removed.
      static java.lang.String keyForType​(java.lang.String typeName)
      Produces the key for a given resource type.
      void setDebugPath​(java.lang.String debugPath)
      Sets the debug path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PREFIX_TYPE

        public static final java.lang.String PREFIX_TYPE
        The prefix used for types in the Add/RemoveFormatter fields in the configuration.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CmsFormatterChangeSet

        public CmsFormatterChangeSet​(java.util.Collection<java.lang.String> toRemove,
                                     java.util.Collection<java.lang.String> toAdd,
                                     java.lang.String siteRoot,
                                     boolean removeAllNonExplicitlyAdded,
                                     boolean removeFunctions,
                                     java.util.Set<CmsUUID> functions,
                                     java.util.Set<CmsUUID> functionsToRemove)
        Creates a new formatter change set.

        Parameters:
        toRemove - the formatter keys to remove
        toAdd - the formatter keys to add
        siteRoot - the site root of the current config
        removeAllNonExplicitlyAdded - flag, indicating if all formatters that are not explicitly added should be removed
        removeFunctions - if true, all functions are removed
        functions - the set of functions to enable
        functionsToRemove - the set of functions to remove
    • Method Detail

      • keyForType

        public static java.lang.String keyForType​(java.lang.String typeName)
        Produces the key for a given resource type.

        Parameters:
        typeName - the resource type name
        Returns:
        the key to use
      • applyToFormatters

        public void applyToFormatters​(CmsFormatterIndex formatterIndex,
                                      CmsFormatterConfigurationCacheState externalFormatters)
        Applies this change set to a list of external (non schema-based) formatters.

        Parameters:
        formatterIndex - the collection of formatters on which this change set should operate
        externalFormatters - the formatter collection which should be used to add formatters which are not already present in 'formatters'
      • applyToTypes

        public void applyToTypes​(java.util.Set<java.lang.String> types)
        Applies the changes (addition or removal of schema formatters) to a set of resource type names, adding resource types for which schema formatters should be added and removing those for which schema formatters should be removed.

        Parameters:
        types - the set of types to apply the changes to
      • setDebugPath

        public void setDebugPath​(java.lang.String debugPath)
        Sets the debug path.
        Parameters:
        debugPath - the debug path