Class FieldProcessorRegistry

  • Direct Known Subclasses:
    ContentModelFieldProcessorRegistry

    public class FieldProcessorRegistry
    extends Object
    Holds a FieldProcessor implementation for the fields that can be processed by the FormProcessor.
    Since:
    3.4
    Author:
    Nick Smith
    • Constructor Detail

      • FieldProcessorRegistry

        public FieldProcessorRegistry()
    • Method Detail

      • register

        public void register​(String key,
                             FieldProcessor processor)
        Registers a FieldProcessor with this registry using the specified key.
        Parameters:
        key - String
        processor - FieldProcessor
      • getFieldProcessor

        protected FieldProcessor getFieldProcessor​(String fieldName)
        Returns a FieldProcessor for the given field name.
        Parameters:
        fieldName - String
        Returns:
        The FieldProcessor implementation for the field or null if there isn't one regsitered.
      • useDefaultProcessor

        protected boolean useDefaultProcessor​(String fieldName)
        Determines if the defaultProcessor should be used.
        Parameters:
        fieldName - String
        Returns:
        true if the defaultProcessor should be used, otherwise false.
      • getKey

        protected String getKey​(String fieldName)
        Derives the key used to look up the FieldProcessor from the fieldName.
        Parameters:
        fieldName - String
        Returns:
        the key used to look up the FieldProcessor.
      • setDefaultProcessor

        public void setDefaultProcessor​(FieldProcessor defaultProcessor)
        Sets the default field processor instance.
        Parameters:
        defaultProcessor - the defaultProcessor to set