本文整理汇总了Java中org.jongo.marshall.jackson.JacksonMapper类的典型用法代码示例。如果您正苦于以下问题:Java JacksonMapper类的具体用法?Java JacksonMapper怎么用?Java JacksonMapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JacksonMapper类属于org.jongo.marshall.jackson包,在下文中一共展示了JacksonMapper类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: BlogPostRepository
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
@Inject
public BlogPostRepository(@Named("dbName") String dbName, MongoClient mongoClient) {
DB mongoDb = mongoClient.getDB(dbName);
jongo = new Jongo(mongoDb,
new JacksonMapper.Builder()
.registerModule(new Jdk8Module())
.registerModule(new JavaTimeModule())
.build());
}
开发者ID:JeffLeFoll,项目名称:polymer-101-backend,代码行数:11,代码来源:BlogPostRepository.java
示例2: CommentRepository
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
@Inject
public CommentRepository(@Named("dbName") String dbName, MongoClient mongoClient) {
DB mongoDb = mongoClient.getDB(dbName);
jongo = new Jongo(mongoDb,
new JacksonMapper.Builder()
.registerModule(new Jdk8Module())
.registerModule(new JavaTimeModule())
.build());
}
开发者ID:JeffLeFoll,项目名称:polymer-101-backend,代码行数:11,代码来源:CommentRepository.java
示例3: jongo
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
@Bean
public Jongo jongo() {
DB db = mongoClient.getDB(mongoProperties.getMongoClientDatabase());
Mapper mapper =
new JacksonMapper.Builder()
.registerModule(new Jdk8Module())
.registerModule(new GuavaModule())
.setVisibilityChecker(VisibilityChecker.Std.defaultInstance())
.build();
return new Jongo(db, mapper);
}
开发者ID:nosceon,项目名称:tenorite,代码行数:14,代码来源:SystemConfig.java
示例4: getMongoCollection
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
public MongoCollection getMongoCollection(MongoClient client, String collectionName) {
DB db = client.getDB(this.db);
Jongo jongo = new Jongo(db,new JacksonMapper.Builder()
.registerModule(new JSR353Module())
.registerModule(new JsonOrgModule()).build());
MongoCollection collection = jongo.getCollection(collectionName);
return collection;
}
开发者ID:denkbar,项目名称:step,代码行数:11,代码来源:MongoDBAccessorHelper.java
示例5: loadHeaterCollection
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
/**
* TODO: description
*/
private void loadHeaterCollection() {
SimpleModule module = new SimpleModule();
module.addDeserializer(HeaterUnit.class, new HeaterUnitDeserializer());
Jongo jongo = new Jongo(db, new JacksonMapper.Builder().registerModule(module).build());
heatersDBCollection = jongo.getCollection(parser.getHeaterCollection(deviceFamily));
}
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:10,代码来源:ThermalUnitsFactory.java
示例6: loadThermometerCollection
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
/**
* TODO: description
*/
private void loadThermometerCollection() {
SimpleModule module = new SimpleModule();
module.addDeserializer(ThermometerUnit.class, new ThermometerUnitDeserializer());
Jongo jongo = new Jongo(db, new JacksonMapper.Builder().registerModule(module).build());
thermometersDBCollection = jongo.getCollection(parser.getThermometersCollection(deviceFamily));
}
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:11,代码来源:ThermalUnitsFactory.java
示例7: setUp
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
DB db = new MongoClient().getDB("JGeneriloDB");
SimpleModule module = new SimpleModule();
module.addDeserializer(HeaterUnit.class, new HeaterUnitDeserializer());
Jongo jongo = new Jongo(db, new JacksonMapper.Builder()
.registerModule(module).build());
MongoCollection heaters = jongo.getCollection("virtex5heaters");
testUnit = heaters.findOne().as(HeaterUnit.class);
}
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:13,代码来源:HeaterUnitTest.java
示例8: testDeserialize
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
@Test
public void testDeserialize() throws Exception {
RcFileParser parser = new RcFileParser();
DB db = new MongoClient().getDB(parser.getDatabaseName());
SimpleModule module = new SimpleModule();
module.addDeserializer(ThermalUnit.class, new ThermometerUnitDeserializer());
Jongo jongo = new Jongo(db, new JacksonMapper.Builder().registerModule(module).build());
MongoCollection thermometersDBCollection = jongo.getCollection(parser.getThermometersCollection("virtex5"));
ThermometerUnit thermometerUnit = thermometersDBCollection.findOne(String.format("{ 'type': '%s'}", "RO1")).as(ThermometerUnit.class);
}
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:13,代码来源:ThermometerUnitDeserializerTest.java
示例9: testDeserialize
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
@Test
public void testDeserialize() throws Exception {
RcFileParser parser = new RcFileParser();
DB db = new MongoClient().getDB(parser.getDatabaseName());
SimpleModule module = new SimpleModule();
module.addDeserializer(HeaterUnit.class, new HeaterUnitDeserializer());
Jongo jongo = new Jongo(db, new JacksonMapper.Builder().registerModule(module).build());
MongoCollection heatersDBCollection = jongo.getCollection(parser.getHeaterCollection("virtex5"));
HeaterUnit heaterUnit = heatersDBCollection.findOne(String.format("{ 'type': '%s'}", "RO1")).as(HeaterUnit.class);
}
开发者ID:ComputerArchitectureGroupPWr,项目名称:JGenerilo,代码行数:13,代码来源:HeaterUnitDeserializerTest.java
示例10: createDefault
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
public static Jongo createDefault(DB db) {
Builder builder = new JacksonMapper.Builder();
builder.enable(MapperFeature.AUTO_DETECT_GETTERS);
builder.addSerializer(DateTime.class, new JodaMapping.MongoDateTimeSerializer());
builder.addDeserializer(DateTime.class, new JodaMapping.MongoDateTimeDeserializer());
builder.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
builder.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
return new Jongo(db, builder.build());
}
开发者ID:taimos,项目名称:spring-dao-mongo,代码行数:10,代码来源:JongoFactory.java
示例11: createMapper
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
protected Mapper createMapper() {
Builder builder = new JacksonMapper.Builder();
builder.enable(MapperFeature.AUTO_DETECT_GETTERS);
builder.addSerializer(DateTime.class, new JodaMapping.MongoDateTimeSerializer());
builder.addDeserializer(DateTime.class, new JodaMapping.MongoDateTimeDeserializer());
builder.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
builder.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
return builder.build();
}
开发者ID:taimos,项目名称:spring-dao-mongo,代码行数:10,代码来源:Tester.java
示例12: Jongoby
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
/**
* Creates a new {@link Jongoby} module and use the default mapper.
*/
public Jongoby() {
this(new JacksonMapper.Builder());
}
开发者ID:jooby-project,项目名称:jooby,代码行数:7,代码来源:Jongoby.java
示例13: mapper
import org.jongo.marshall.jackson.JacksonMapper; //导入依赖的package包/类
@Bean
public Mapper mapper() {
return new JacksonMapper.Builder().build();
}
开发者ID:CarloMicieli,项目名称:trenako-v2,代码行数:5,代码来源:DataConfig.java
注:本文中的org.jongo.marshall.jackson.JacksonMapper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论