Java 类org.jsonschema2pojo.AnnotationStyle 实例源码

项目:GitHub    文件:ObjectRule.java   
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);
    }
}
项目:aml    文件:ConfigurationDialog.java   
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;
}
项目:aml    文件:GenerationHandler.java   
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;
}
项目:raml-module-builder    文件:GenerateRunner.java   
/**
 * 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);
}
项目:GitHub    文件:Jsonschema2PojoMojo.java   
@Override
public AnnotationStyle getAnnotationStyle() {
    return AnnotationStyle.valueOf(annotationStyle.toUpperCase());
}
项目:GitHub    文件:ObjectRule.java   
private boolean usesPolymorphicDeserialization(JsonNode node) {
    if (ruleFactory.getGenerationConfig().getAnnotationStyle() == AnnotationStyle.JACKSON2) {
        return node.has("deserializationClassProperty");
    }
    return false;
}
项目:GitHub    文件:Jsonschema2PojoTask.java   
@Override
public AnnotationStyle getAnnotationStyle() {
    return annotationStyle;
}
项目:GitHub    文件:Arguments.java   
@Override
public AnnotationStyle getAnnotationStyle() {
    return annotationStyle;
}
项目:raml-maven-plugin    文件:AbstractSpringWebMojo.java   
private static Annotator requireAnnotator(AnnotationStyle annotationStyle) {
    checkState(ANNOTATOR_SUPPLIER_INDEX.containsKey(annotationStyle), "Illegal annotation style: %s", annotationStyle);
    return ANNOTATOR_SUPPLIER_INDEX.get(annotationStyle).get();
}
项目:raml-maven-plugin    文件:AbstractSpringWebMojo.java   
@Override
public AnnotationStyle getAnnotationStyle() {
    return firstNonNull(config.getAnnotationStyle(), super.getAnnotationStyle());
}
项目:raml-maven-plugin    文件:SchemaGeneratorConfig.java   
public AnnotationStyle getAnnotationStyle() {
    return annotationStyle;
}
项目:GitHub    文件:Jsonschema2PojoTask.java   
/**
 * 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;
}
项目:aml    文件:Configuration.java   
/**
 * <p>Getter for the field <code>jsonMapper</code>.</p>
 *
 * @return a {@link org.jsonschema2pojo.AnnotationStyle} object.
 */
public AnnotationStyle getJsonMapper()
{
    return jsonMapper;
}
项目:aml    文件:Configuration.java   
/**
 * <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;
}
项目:aml    文件:Configuration.java   
/**
 * <p>Getter for the field <code>jsonMapper</code>.</p>
 *
 * @return a {@link org.jsonschema2pojo.AnnotationStyle} object.
 */
public AnnotationStyle getJsonMapper()
{
    return jsonMapper;
}
项目:aml    文件:Configuration.java   
/**
 * <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;
}