public class MapTranslatorFactory extends java.lang.Object implements TranslatorFactory<java.util.Map<java.lang.String,java.lang.Object>>
Translator which manages an expando-style Map. The key must be 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.
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 |
MapTranslatorFactory.MapMapNodeTranslator |
Constructor and Description |
---|
MapTranslatorFactory() |
Modifier and Type | Method and Description |
---|---|
Translator<java.util.Map<java.lang.String,java.lang.Object>> |
create(Path path,
Property property,
java.lang.reflect.Type type,
CreateContext ctx) |
public Translator<java.util.Map<java.lang.String,java.lang.Object>> create(Path path, Property property, java.lang.reflect.Type type, CreateContext ctx)
create
in interface TranslatorFactory<java.util.Map<java.lang.String,java.lang.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
List