public class EmbedMapTranslatorFactory extends Object implements TranslatorFactory<Map<Object,Object>>
Translator which manages an expando-style Map. The key must be String (or something that converts easily to and from String), which becomes a normal path element in the entity. The value can be anything that goes into a Collection; a basic type, an embedded type, a reference, a null, etc. Pretty much the same attribute rules apply as apply to Collections.
Map keys cannot contain '.' and cannot be null. The types currently allowed are:
At some point this may be expanded to cover any class that has a String constructor, static valueOf(String), or static create(String) method.
However, Maps are not list structures, so you don't have the same restriction on embedding; you can put maps inside of maps and lists inside of maps.
Modifier and Type | Class and Description |
---|---|
static class |
EmbedMapTranslatorFactory.MapMapNodeTranslator |
Constructor and Description |
---|
EmbedMapTranslatorFactory() |
public Translator<Map<Object,Object>> create(Path path, Property property, Type type, CreateContext ctx)
create
in interface TranslatorFactory<Map<Object,Object>>
path
- current path to this part of the tree, important for logging and exceptionsproperty
- is the property we are inspecting to create a translator fortype
- is the generic type of the field (or field component). For example, examining a field of type
ListCopyright © 2014. All rights reserved.