Interface TranslatorFactory<P,​D>

All Known Implementing Classes:
ArrayTranslatorFactory, AsIsTranslatorFactory, BigDecimalLongTranslatorFactory, BigMoneyStringTranslatorFactory, ByteArrayTranslatorFactory, ClassTranslatorFactory, CollectionTranslatorFactory, ContainerTranslatorFactory, DateTimeZoneTranslatorFactory, EmbeddedMapTranslatorFactory, EnumTranslatorFactory, KeyTranslatorFactory, MapifyTranslatorFactory, MoneyStringTranslatorFactory, NumberTranslatorFactory, ReadableInstantTranslatorFactory, ReadablePartialTranslatorFactory, RefTranslatorFactory, SerializeTranslatorFactory, SqlDateTranslatorFactory, StringTranslatorFactory, TextTranslatorFactory, 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
  • 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.