本文整理汇总了Java中com.googlecode.objectify.impl.translate.TranslatorFactory类的典型用法代码示例。如果您正苦于以下问题:Java TranslatorFactory类的具体用法?Java TranslatorFactory怎么用?Java TranslatorFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TranslatorFactory类属于com.googlecode.objectify.impl.translate包,在下文中一共展示了TranslatorFactory类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerTranslators
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
/** Register translators that allow less common types to be stored directly in Datastore. */
private static void registerTranslators() {
for (TranslatorFactory<?> translatorFactory : ImmutableList.of(
new BloomFilterOfStringTranslatorFactory(),
new CidrAddressBlockTranslatorFactory(),
new CommitLogRevisionsTranslatorFactory(),
new CreateAutoTimestampTranslatorFactory(),
new CurrencyUnitTranslatorFactory(),
new DurationTranslatorFactory(),
new InetAddressTranslatorFactory(),
new MoneyStringTranslatorFactory(),
new ReadableInstantUtcTranslatorFactory(),
new UpdateAutoTimestampTranslatorFactory())) {
factory().getTranslators().add(translatorFactory);
}
}
示例2: configureObjectify
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
private void configureObjectify() {
for (TranslatorFactory translatorFactory : objectifyTranslatorFactories()) {
ObjectifyService.factory().getTranslators().add(translatorFactory);
}
for (Class<?> entityClass : objectifyEntities()) {
ObjectifyService.register(entityClass);
}
}
示例3: objectifyTranslatorFactories
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
public static Set<TranslatorFactory> objectifyTranslatorFactories() {
Set<TranslatorFactory> translators = Sets.newHashSet(
// Add BigDecimal support here when you need it. BigDecimalLongTransformer requires a decision to be made about expected precision (default 6).
);
translators.addAll(Jsr310Translators.translators());
return translators;
}
示例4: translators
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
public static Set<TranslatorFactory> translators() {
return Sets.newHashSet(
new LocalDateDateTranslatorFactory(),
new OffsetDateTimeDateTranslatorFactory(),
new ZonedDateTimeDateTranslatorFactory()
);
}
示例5: addDefaultTranslators
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
@Test
public void addDefaultTranslators() {
ObjectifyModule.addDefaultTranslators();
Translators translators = ObjectifyService.factory().getTranslators();
List<TranslatorFactory<?, ?>> factories = TestSupport.getField(translators, "translatorFactories");
assertThat(factoriesContain(factories, ReadableInstantTranslatorFactory.class), is(true));
assertThat(factoriesContain(factories, ReadablePartialTranslatorFactory.class), is(true));
assertThat(factoriesContain(factories, DateTimeZoneTranslatorFactory.class), is(true));
}
示例6: factoriesContain
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
private boolean factoriesContain(List<TranslatorFactory<?, ?>> factories, Class<? extends TranslatorFactory<?, ?>> class1) {
for (TranslatorFactory<?, ?> factory : factories) {
if (factory.getClass() == class1) {
return true;
}
}
return false;
}
示例7: addTranslators
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
@Override
protected void addTranslators(ObjectifyFactory factory) {
for (TranslatorFactory translatorFactory : ApplicationModule.objectifyTranslatorFactories()) {
factory.getTranslators().add(translatorFactory);
}
}
示例8: registerObjectifyTranslators
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
/**
* Register translators with Objectify.
* Translators registered here will override any matching translators registered in {@link ObjectifyAutoConfiguration}.
*
* @return Collection of entities to register.
*/
default Collection<TranslatorFactory<?, ?>> registerObjectifyTranslators() {
return Collections.emptyList();
}