public class AsIsTranslatorFactory extends Object implements TranslatorFactory<Object>
This should be the last translator in the list - the one to try when nothing else wants the type. It just copies the value as-is. This is used for simple values that get stored natively; GeoPt, Email, etc. It will also end up trying to save any random value whether it can be saved or not. The datastore will complain when the entity property is set.
Also - this fixes the boolean.class vs Boolean.class mismatch.
Constructor and Description |
---|
AsIsTranslatorFactory() |
public Translator<Object> create(Path path, Property property, Type type, CreateContext ctx)
create
in interface TranslatorFactory<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.