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

public abstract class ValueTranslatorFactory<P,D> extends Object implements TranslatorFactory<P,D>
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 Details

    • ValueTranslatorFactory

      public ValueTranslatorFactory()
  • Method Details

    • create

      public final Translator<P,D> create(TypeKey<P> tk, CreateContext ctx, Path path)
      Description copied from interface: TranslatorFactory
      Create a translator for a type.
      Specified by:
      create in interface TranslatorFactory<P,D>
      Parameters:
      tk - defines the type which is to be translated
      path - 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