Class KeyedSmartQuotedTemplateMapper

java.lang.Object
net.solarnetwork.settings.support.KeyedSmartQuotedTemplateMapper
All Implemented Interfaces:
MappableSpecifier.Mapper

public class KeyedSmartQuotedTemplateMapper extends Object implements MappableSpecifier.Mapper
Dynamically maps property keys to support nested collections.

Only if the key passed to mapKey(String) is a simple property, it will be quoted. A simple property is one named with only letters, numbers, and underscore characters.

Version:
1.0
Author:
matt
  • Field Details

    • DEFAULT_TEMPLATE

      public static final String DEFAULT_TEMPLATE
      The default value for the template property.
      See Also:
  • Constructor Details

    • KeyedSmartQuotedTemplateMapper

      public KeyedSmartQuotedTemplateMapper()
  • Method Details

    • mapKey

      public String mapKey(String key)
      Description copied from interface: MappableSpecifier.Mapper
      Map an input key to an output key.
      Specified by:
      mapKey in interface MappableSpecifier.Mapper
      Parameters:
      key - the key to map
      Returns:
      the mapped key
    • getTemplate

      public String getTemplate()
      Get the template.
      Returns:
      the template
    • setTemplate

      public void setTemplate(String template)
      Set a format template that accepts a single parameter to be within the template quote.
      Parameters:
      template - the format template to use; defaults to DEFAULT_TEMPLATE