com.fasterxml.jackson.dataformat.yaml.YAMLMapper.disable()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中com.fasterxml.jackson.dataformat.yaml.YAMLMapper.disable()方法的一些代码示例,展示了YAMLMapper.disable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLMapper.disable()方法的具体详情如下:
包路径:com.fasterxml.jackson.dataformat.yaml.YAMLMapper
类名称:YAMLMapper
方法名:disable

YAMLMapper.disable介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

public YAMLMapper configure(YAMLGenerator.Feature f, boolean state) {
  return state ? enable(f) : disable(f);
}

代码示例来源:origin: redisson/redisson

public YAMLMapper configure(YAMLParser.Feature f, boolean state) {
  return state ? enable(f) : disable(f);
}

代码示例来源:origin: com.fasterxml.jackson.dataformat/jackson-dataformat-yaml

public YAMLMapper configure(YAMLGenerator.Feature f, boolean state) {
  return state ? enable(f) : disable(f);
}

代码示例来源:origin: com.fasterxml.jackson.dataformat/jackson-dataformat-yaml

public YAMLMapper configure(YAMLParser.Feature f, boolean state) {
  return state ? enable(f) : disable(f);
}

代码示例来源:origin: strimzi/strimzi-kafka-operator

public static <T> String toYamlString(T instance) {
  ObjectMapper mapper = new YAMLMapper()
      .disable(YAMLGenerator.Feature.USE_NATIVE_TYPE_ID)
      .setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
  try {
    return mapper.writeValueAsString(instance);
  } catch (JsonProcessingException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: strimzi/strimzi-kafka-operator

@Override
public String toString() {
  YAMLMapper mapper = new YAMLMapper().disable(YAMLGenerator.Feature.USE_NATIVE_TYPE_ID);
  try {
    return mapper.writeValueAsString(this);
  } catch (JsonProcessingException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: strimzi/strimzi-kafka-operator

@Override
public String toString() {
  YAMLMapper mapper = new YAMLMapper().disable(YAMLGenerator.Feature.USE_NATIVE_TYPE_ID);
  try {
    return mapper.writeValueAsString(this);
  } catch (JsonProcessingException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: strimzi/strimzi-kafka-operator

@Override
public String toString() {
  YAMLMapper mapper = new YAMLMapper().disable(YAMLGenerator.Feature.USE_NATIVE_TYPE_ID);
  try {
    return mapper.writeValueAsString(this);
  } catch (JsonProcessingException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: com.haulmont.cuba/cuba-rest-api

@RequestMapping(value = "/swaggerDetailed.yaml", method = RequestMethod.GET, produces = "application/yaml")
public String getProjectSwaggerYaml() {
  ObjectMapper jsonWriter = new ObjectMapper()
      .setSerializationInclusion(JsonInclude.Include.NON_NULL);
  YAMLMapper yamlMapper = new YAMLMapper()
      .disable(WRITE_DOC_START_MARKER);
  try {
    Swagger swagger = swaggerGenerator.generateSwagger();
    JsonNode jsonNode = jsonWriter.readTree(
        jsonWriter.writeValueAsBytes(swagger));
    return yamlMapper.writeValueAsString(jsonNode);
  } catch (IOException e) {
    throw new RestAPIException("An error occurred while generating Swagger documentation", e.getMessage(),
        HttpStatus.INTERNAL_SERVER_ERROR, e);
  }
}

相关文章