Class CmsFormatterConfigurationCacheState
java.lang.Object
org.opencms.ade.configuration.formatters.CmsFormatterConfigurationCacheState
Represents the currently cached collection of all formatter beans extracted from formatter configuration files.
Objects of this class are immutable, but have a method to create an updated copy.
-
Constructor Summary
ConstructorDescriptionCmsFormatterConfigurationCacheState
(Map<CmsUUID, I_CmsFormatterBean> formatters) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateUpdatedCopy
(Map<CmsUUID, I_CmsFormatterBean> updateFormatters) Creates a new copy of this state in which some entries are removed or replaced.Gets the map of formatters which are automatically enabled.Gets the map of all formatters.getFormattersForType
(String resourceType, boolean filterAutoEnabled) Gets the formatters for a specific resource types, and optionally only returns those which are automatically enabled.
-
Constructor Details
-
CmsFormatterConfigurationCacheState
Creates a new instance.- Parameters:
formatters
- the initial map of formatters
-
-
Method Details
-
createUpdatedCopy
public CmsFormatterConfigurationCacheState createUpdatedCopy(Map<CmsUUID, I_CmsFormatterBean> updateFormatters) Creates a new copy of this state in which some entries are removed or replaced.This does not change the state object on which the method is called.
- Parameters:
updateFormatters
- a map of formatters to change, where the key is the structure id and the value is either the replacement or null if the map entry should be removed- Returns:
- the updated copy
-
getAutoEnabledFormatters
Gets the map of formatters which are automatically enabled.- Returns:
- the map of automatically enabled formatters with structure ids as keys
-
getFormatters
Gets the map of all formatters.- Returns:
- the map of all formatters
-
getFormattersForType
public Collection<I_CmsFormatterBean> getFormattersForType(String resourceType, boolean filterAutoEnabled) Gets the formatters for a specific resource types, and optionally only returns those which are automatically enabled.- Parameters:
resourceType
- the resource type namefilterAutoEnabled
- true if only the automatically enabled formatters should be returned- Returns:
- the formatters for the type
-