• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AnnotationStyle类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.jsonschema2pojo.AnnotationStyle的典型用法代码示例。如果您正苦于以下问题:Java AnnotationStyle类的具体用法?Java AnnotationStyle怎么用?Java AnnotationStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AnnotationStyle类属于org.jsonschema2pojo包,在下文中一共展示了AnnotationStyle类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addJsonTypeInfoAnnotation

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
private void addJsonTypeInfoAnnotation(JDefinedClass jclass, JsonNode node) {
    if (ruleFactory.getGenerationConfig().getAnnotationStyle() == AnnotationStyle.JACKSON2) {
        String annotationName = node.get("deserializationClassProperty").asText();
        JAnnotationUse jsonTypeInfo = jclass.annotate(JsonTypeInfo.class);
        jsonTypeInfo.param("use", JsonTypeInfo.Id.CLASS);
        jsonTypeInfo.param("include", JsonTypeInfo.As.PROPERTY);
        jsonTypeInfo.param("property", annotationName);
    }
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:10,
代码来源:ObjectRule.java

示例2: getAnnotationStyleRealm

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
private List<String> getAnnotationStyleRealm(){
	
	ArrayList<String> result=  new ArrayList<String>(Arrays.asList(
			
		AnnotationStyle.GSON.name(),
		AnnotationStyle.JACKSON.name(),
		AnnotationStyle.JACKSON1.name(),
		AnnotationStyle.JACKSON2.name(),
		AnnotationStyle.NONE.name()
	)); 
			
	return result;
}
 

开发者ID:OnPositive,
项目名称:aml,
代码行数:14,
代码来源:ConfigurationDialog.java

示例3: prepareConfiguraton

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
private Configuration prepareConfiguraton(UIConfiguration uiConfig)
{
	IContainer srcFolder = uiConfig.getSrcFolder();
	if(srcFolder == null){
		srcFolder = uiConfig.getRamlFile().getParent();
	}
	File srcOSFolder = srcFolder.getLocation().toFile();		
	File dstOSFolder = uiConfig.getDstFolder().getLocation().toFile();
	
	Configuration configuration = new Configuration();
	configuration.setOutputDirectory(dstOSFolder);
	configuration.setSourceDirectory(srcOSFolder);
	configuration.setBasePackageName(uiConfig.getBasePackageName());
	configuration.setGenerateClientInterface(uiConfig.getGenerateClientProxy());
	JaxrsVersion jaxrsVersion = JaxrsVersion.valueOf(uiConfig.getJaxrsVersion());
	if(jaxrsVersion!=null){
		configuration.setJaxrsVersion(jaxrsVersion);
	}
	
	AnnotationStyle jsonMapper = AnnotationStyle.valueOf(uiConfig.getJsonMapper());
	if(jsonMapper!=null){
		configuration.setJsonMapper(jsonMapper);
	}
	
	configuration.setUseJsr303Annotations(uiConfig.getUseJsr303Annotations());
	configuration.setEmptyResponseReturnVoid(uiConfig.getEmptyResponseUsesVoid());
	return configuration;
}
 

开发者ID:OnPositive,
项目名称:aml,
代码行数:29,
代码来源:GenerationHandler.java

示例4: GenerateRunner

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
/**
 * Create a GenerateRunner for a specific target directory.
 * <p>
 * The output directory of the .java client is
 * <code>src/main/java/org/folio/rest/client</code>,
 * the output directory of the .java pojos is
 * <code>src/main/java/org/folio/rest/jaxrs/model</code>,
 * the output directory of the RAML and dereferenced schema files is
 * <code>target/classes</code>; they are relative to the parameter
 * <code>outputDirectory</code>.
 *
 * @param outputDirectory  where to write the files to
 */
public GenerateRunner(String outputDirectory) {
  this.outputDirectory = outputDirectory;
  outputDirectoryWithPackage = outputDirectory + PACKAGE_DEFAULT.replace('.', '/');
  modelDirectory = outputDirectory + MODEL_PACKAGE_DEFAULT.replace('.', '/');

  List<GeneratorExtension> extensions = new ArrayList<>();
  extensions.add(new Raml2Java());
  configuration = new Configuration();
  configuration.setJaxrsVersion(JaxrsVersion.JAXRS_2_0);
  configuration.setUseJsr303Annotations(true);
  configuration.setJsonMapper(AnnotationStyle.JACKSON2);
  configuration.setBasePackageName(PACKAGE_DEFAULT);
  configuration.setExtensions(extensions);
}
 

开发者ID:folio-org,
项目名称:raml-module-builder,
代码行数:28,
代码来源:GenerateRunner.java

示例5: getAnnotationStyle

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
@Override
public AnnotationStyle getAnnotationStyle() {
    return AnnotationStyle.valueOf(annotationStyle.toUpperCase());
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:5,
代码来源:Jsonschema2PojoMojo.java

示例6: usesPolymorphicDeserialization

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
private boolean usesPolymorphicDeserialization(JsonNode node) {
    if (ruleFactory.getGenerationConfig().getAnnotationStyle() == AnnotationStyle.JACKSON2) {
        return node.has("deserializationClassProperty");
    }
    return false;
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:7,
代码来源:ObjectRule.java

示例7: getAnnotationStyle

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
@Override
public AnnotationStyle getAnnotationStyle() {
    return annotationStyle;
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:5,
代码来源:Jsonschema2PojoTask.java

示例8: requireAnnotator

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
private static Annotator requireAnnotator(AnnotationStyle annotationStyle) {
    checkState(ANNOTATOR_SUPPLIER_INDEX.containsKey(annotationStyle), "Illegal annotation style: %s", annotationStyle);
    return ANNOTATOR_SUPPLIER_INDEX.get(annotationStyle).get();
}
 

开发者ID:hubrick,
项目名称:raml-maven-plugin,
代码行数:5,
代码来源:AbstractSpringWebMojo.java

示例9: getAnnotationStyle

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
@Override
public AnnotationStyle getAnnotationStyle() {
    return firstNonNull(config.getAnnotationStyle(), super.getAnnotationStyle());
}
 

开发者ID:hubrick,
项目名称:raml-maven-plugin,
代码行数:5,
代码来源:AbstractSpringWebMojo.java

示例10: getAnnotationStyle

点赞 2

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
public AnnotationStyle getAnnotationStyle() {
    return annotationStyle;
}
 

开发者ID:hubrick,
项目名称:raml-maven-plugin,
代码行数:4,
代码来源:SchemaGeneratorConfig.java

示例11: setAnnotationStyle

点赞 1

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
/**
 * Sets the 'annotationStyle' property of this class
 *
 * @param annotationStyle
 *            The style of annotations to use in the generated Java types.
 */
public void setAnnotationStyle(AnnotationStyle annotationStyle) {
    this.annotationStyle = annotationStyle;
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:10,
代码来源:Jsonschema2PojoTask.java

示例12: getJsonMapper

点赞 1

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
/**
 * <p>Getter for the field <code>jsonMapper</code>.</p>
 *
 * @return a {@link org.jsonschema2pojo.AnnotationStyle} object.
 */
public AnnotationStyle getJsonMapper()
{
    return jsonMapper;
}
 

开发者ID:OnPositive,
项目名称:aml,
代码行数:10,
代码来源:Configuration.java

示例13: setJsonMapper

点赞 1

import org.jsonschema2pojo.AnnotationStyle; //导入依赖的package包/类
/**
 * <p>Setter for the field <code>jsonMapper</code>.</p>
 *
 * @param jsonMapper a {@link org.jsonschema2pojo.AnnotationStyle} object.
 */
public void setJsonMapper(final AnnotationStyle jsonMapper)
{
    this.jsonMapper = jsonMapper;
}
 

开发者ID:OnPositive,
项目名称:aml,
代码行数:10,
代码来源:Configuration.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)