本文整理汇总了Java中org.jsonschema2pojo.Jackson2Annotator类的典型用法代码示例。如果您正苦于以下问题:Java Jackson2Annotator类的具体用法?Java Jackson2Annotator怎么用?Java Jackson2Annotator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Jackson2Annotator类属于org.jsonschema2pojo包,在下文中一共展示了Jackson2Annotator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAnnotator
import org.jsonschema2pojo.Jackson2Annotator; //导入依赖的package包/类
private Annotator getAnnotator() {
ArrayList<Annotator> annotators = new ArrayList<>();
if (config.isGsonSupport()) {
annotators.add(new GsonAnnotator());
}
if (config.isJacksonSupport()) {
annotators.add(new Jackson2Annotator());
}
CompositeAnnotator ac = new CompositeAnnotator(annotators.toArray(new Annotator[annotators.size()]));
return ac;
}
开发者ID:OnPositive,项目名称:aml,代码行数:12,代码来源:JavaWriter.java
示例2: createSchemaMapper
import org.jsonschema2pojo.Jackson2Annotator; //导入依赖的package包/类
private SchemaMapper createSchemaMapper() {
final RuleFactory ruleFactory = new RuleFactory();
ruleFactory.setAnnotator(new Jackson2Annotator() {
@Override
public boolean isAdditionalPropertiesSupported() {
return false;
}
});
ruleFactory.setGenerationConfig(config);
return new SchemaMapper(ruleFactory, new SchemaGenerator());
}
开发者ID:fabric8io,项目名称:data-mapper,代码行数:13,代码来源:JsonModelGenerator.java
示例3: main
import org.jsonschema2pojo.Jackson2Annotator; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
// BEGIN EXAMPLE
JCodeModel codeModel = new JCodeModel();
URL source = new URL("file:///path/to/my/schema.json");
GenerationConfig config = new DefaultGenerationConfig() {
@Override
public boolean isGenerateBuilders() { // set config option by overriding method
return true;
}
};
SchemaMapper mapper = new SchemaMapper(new RuleFactory(config, new Jackson2Annotator(config), new SchemaStore()), new SchemaGenerator());
mapper.generate(codeModel, "ClassName", "com.example", source);
codeModel.build(new File("output"));
// END EXAMPLE
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:Example.java
示例4: RuleFactory
import org.jsonschema2pojo.Jackson2Annotator; //导入依赖的package包/类
/**
* Create a rule factory with the default generation config options.
*
* @see DefaultGenerationConfig
*/
public RuleFactory() {
this(new DefaultGenerationConfig(), new Jackson2Annotator(new DefaultGenerationConfig()), new SchemaStore());
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:RuleFactory.java
注:本文中的org.jsonschema2pojo.Jackson2Annotator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论