Class ValueTranslatorFactory<P,D>
java.lang.Object
com.googlecode.objectify.impl.translate.ValueTranslatorFactory<P,D>
- All Implemented Interfaces:
TranslatorFactory<P,
D>
- Direct Known Subclasses:
EnumTranslatorFactory
,ReadableInstantTranslatorFactory
,ReadablePartialTranslatorFactory
,RefTranslatorFactory
,SimpleTranslatorFactory
Provides a little boilerplate for translators that work on simple atomic types. Automatically
wraps primitives so we don't have to worry about them. Handles indexing for us.
- Author:
- Jeff Schnitzer invalid input: '<'[email protected]>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Translator
<P, D> create
(TypeKey<P> tk, CreateContext ctx, Path path) Create a translator for a type.protected abstract ValueTranslator
<P, D> createValueTranslator
(TypeKey<P> tk, CreateContext ctx, Path path) Create a translator, knowing that we have the appropriate type.
-
Constructor Details
-
ValueTranslatorFactory
public ValueTranslatorFactory()
-
-
Method Details
-
create
Description copied from interface:TranslatorFactory
Create a translator for a type.- Specified by:
create
in interfaceTranslatorFactory<P,
D> - Parameters:
tk
- defines the type which is to be translatedpath
- is where this type was discovered, important for logging and exceptions- Returns:
- null if this factory does not know how to deal with that situation.
-
createValueTranslator
protected abstract ValueTranslator<P,D> createValueTranslator(TypeKey<P> tk, CreateContext ctx, Path path) Create a translator, knowing that we have the appropriate type. You don't need to check for type matching.- Parameters:
tk
- type is guaranteed to erase to something assignable to Class
-