Class KeyedSmartQuotedTemplateMapper
java.lang.Object
net.solarnetwork.settings.support.KeyedSmartQuotedTemplateMapper
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default value for thetemplateproperty. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the template.Map an input key to an output key.voidsetTemplate(String template) Set a format template that accepts a single parameter to be within the template quote.
-
Field Details
-
DEFAULT_TEMPLATE
The default value for thetemplateproperty.- See Also:
-
-
Constructor Details
-
KeyedSmartQuotedTemplateMapper
public KeyedSmartQuotedTemplateMapper()
-
-
Method Details
-
mapKey
Description copied from interface:MappableSpecifier.MapperMap an input key to an output key.- Specified by:
mapKeyin interfaceMappableSpecifier.Mapper- Parameters:
key- the key to map- Returns:
- the mapped key
-
getTemplate
Get the template.- Returns:
- the template
-
setTemplate
Set a format template that accepts a single parameter to be within the template quote.- Parameters:
template- the format template to use; defaults toDEFAULT_TEMPLATE
-