public class TextTemplateConfigSerializer extends Object implements TypeSerializer<TextTemplate>
TextTemplates. TextTemplates are serialized in two parts.
First, the template's arguments as defined by
TextTemplate.getArguments() are serialized to the "arguments" node.
This is where the argument definitions are kept.
Second, the template's text representation as defined by
TextTemplate.toText() is serialized to the "content" node.
Deserialization is a bit more complicated. We start by loading the
"content" Text and check the root Text element as well as it's children. If
LiteralText value is found that is wrapped in curly braces we
check to see if the value inside the braces is defined as an argument in the
"arguments" nodes. If so, we use the name and format from the original
LiteralText and obtain whether the argument is optional from the definition.
This is repeated until there are no more Text children to check and we
return a TextTemplate of the elements we have collected.
|Constructor and Description|
|Modifier and Type||Method and Description|
public TextTemplate deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException