本文整理汇总了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);
}
}
开发者ID:google,项目名称:nomulus,代码行数:17,代码来源:ObjectifyService.java
示例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);
}
}
开发者ID:3wks,项目名称:generator-thundr-gae-react,代码行数:10,代码来源:ApplicationModule.java
示例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;
}
开发者ID:3wks,项目名称:generator-thundr-gae-react,代码行数:9,代码来源:ApplicationModule.java
示例4: translators
import com.googlecode.objectify.impl.translate.TranslatorFactory; //导入依赖的package包/类
public static Set<TranslatorFactory> translators() {
return Sets.newHashSet(
new LocalDateDateTranslatorFactory(),
new OffsetDateTimeDateTranslatorFactory(),
new ZonedDateTimeDateTranslatorFactory()
);
}
开发者ID:3wks,项目名称:generator-thundr-gae-react,代码行数:8,代码来源:Jsr310Translators.java
示例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));
}
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:11,代码来源:ObjectifyModuleTest.java
示例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;
}
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:9,代码来源:ObjectifyModuleTest.java
示例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);
}
}
开发者ID:3wks,项目名称:generator-thundr-gae-react,代码行数:7,代码来源:TestObjectify.java
示例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();
}
开发者ID:n15g,项目名称:spring-boot-gae,代码行数:10,代码来源:ObjectifyConfigurer.java
注:本文中的com.googlecode.objectify.impl.translate.TranslatorFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论