Interface TranslatorFactory<P,D>

All Known Implementing Classes:
ArrayTranslatorFactory, BigDecimalLongTranslatorFactory, BigMoneyStringTranslatorFactory, BlobTranslatorFactory, BooleanTranslatorFactory, ByteArrayTranslatorFactory, ClassTranslatorFactory, CollectionTranslatorFactory, ContainerTranslatorFactory, DateTimeZoneTranslatorFactory, DateTranslatorFactory, EmbeddedMapTranslatorFactory, EnumTranslatorFactory, FloatTranslatorFactory, InstantTranslatorFactory, IntegerTranslatorFactory, KeyTranslatorFactory, LatLngTranslatorFactory, MapifyTranslatorFactory, MoneyStringTranslatorFactory, ObjectTranslatorFactory, RawEntityTranslatorFactory, RawKeyTranslatorFactory, RawValueTranslatorFactory, ReadableInstantTranslatorFactory, ReadablePartialTranslatorFactory, RefTranslatorFactory, SerializeTranslatorFactory, SimpleTranslatorFactory, SqlDateTranslatorFactory, StringTranslatorFactory, TimestampTranslatorFactory, TimeZoneTranslatorFactory, TranslateTranslatorFactory, URLTranslatorFactory, ValueTranslatorFactory

public interface TranslatorFactory<P,D>

A translator knows how to convert between a POJO and a native datastore representation. When an entity class is registered, the known TranslatorFactories are queried to produce a translator for that class; this translator will in turn be composed of translators for all of the fields, etc. These translators become a static metamodel that can efficiently convert back and forth between the formats with minimal runtime overhead.

P is the pojo type, D is the datastore type.

Author:
Jeff Schnitzer <[email protected]>
  • Method Details

    • create

      Translator<P,D> create(TypeKey<P> tk, CreateContext ctx, Path path)
      Create a translator for a type.
      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.