本文整理了Java中com.fasterxml.jackson.dataformat.yaml.YAMLFactory.disable()
方法的一些代码示例,展示了YAMLFactory.disable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLFactory.disable()
方法的具体详情如下:
包路径:com.fasterxml.jackson.dataformat.yaml.YAMLFactory
类名称:YAMLFactory
方法名:disable
[英]Method for disabling specified generator feature (check YAMLGenerator.Feature for list of features)
[中]禁用指定生成器功能的方法(检查YAMLGenerator.feature以获取功能列表)
代码示例来源:origin: redisson/redisson
public YAMLMapper disable(YAMLGenerator.Feature f) {
((YAMLFactory)_jsonFactory).disable(f);
return this;
}
代码示例来源:origin: redisson/redisson
public YAMLMapper disable(YAMLParser.Feature f) {
((YAMLFactory)_jsonFactory).disable(f);
return this;
}
代码示例来源:origin: com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
public YAMLMapper disable(YAMLGenerator.Feature f) {
((YAMLFactory)_jsonFactory).disable(f);
return this;
}
代码示例来源:origin: com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
public YAMLMapper disable(YAMLParser.Feature f) {
((YAMLFactory)_jsonFactory).disable(f);
return this;
}
代码示例来源:origin: redisson/redisson
/**
* Method for enabling or disabling specified generator feature
* (check {@link YAMLGenerator.Feature} for list of features)
*/
public final YAMLFactory configure(YAMLGenerator.Feature f, boolean state) {
if (state) {
enable(f);
} else {
disable(f);
}
return this;
}
代码示例来源:origin: redisson/redisson
/**
* Method for enabling or disabling specified parser feature
* (check {@link YAMLParser.Feature} for list of features)
*/
public final YAMLFactory configure(YAMLParser.Feature f, boolean state)
{
if (state) {
enable(f);
} else {
disable(f);
}
return this;
}
代码示例来源:origin: com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
/**
* Method for enabling or disabling specified parser feature
* (check {@link YAMLParser.Feature} for list of features)
*/
public final YAMLFactory configure(YAMLParser.Feature f, boolean state)
{
if (state) {
enable(f);
} else {
disable(f);
}
return this;
}
代码示例来源:origin: com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
/**
* Method for enabling or disabling specified generator feature
* (check {@link YAMLGenerator.Feature} for list of features)
*/
public final YAMLFactory configure(YAMLGenerator.Feature f, boolean state) {
if (state) {
enable(f);
} else {
disable(f);
}
return this;
}
代码示例来源:origin: swagger-api/swagger-core
protected static ObjectMapper createYaml() {
YAMLFactory factory = new YAMLFactory();
factory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
factory.enable(YAMLGenerator.Feature.MINIMIZE_QUOTES);
factory.enable(YAMLGenerator.Feature.SPLIT_LINES);
factory.enable(YAMLGenerator.Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS);
return create(factory);
}
代码示例来源:origin: HubSpot/Singularity
@Provides
@Singleton
@Named(YAML)
public ObjectMapper providesYamlMapper() {
final YAMLFactory yamlFactory = new YAMLFactory();
yamlFactory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
final ObjectMapper mapper = new ObjectMapper(yamlFactory);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.registerModule(new GuavaModule());
mapper.registerModule(new ProtobufModule());
return mapper;
}
代码示例来源:origin: com.hubspot/SingularityRunnerBase
@Provides
@Singleton
@Named(YAML)
public ObjectMapper providesYamlMapper() {
final YAMLFactory yamlFactory = new YAMLFactory();
yamlFactory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
final ObjectMapper mapper = new ObjectMapper(yamlFactory);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.registerModule(new GuavaModule());
mapper.registerModule(new ProtobufModule());
return mapper;
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Creates YAML generator instance.
* @return YAMLGenerator instance.
*/
private YAMLGenerator createYamlGenerator()
{
final Writer writer = new StringWriter();
YAMLFactory yamlFactory = new YAMLFactory();
yamlFactory.configure(YAMLGenerator.Feature.MINIMIZE_QUOTES, true);
yamlFactory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
try
{
return yamlFactory.createGenerator(writer);
}
catch (IOException ex)
{
throw new RuntimeException("Cannot create YAML generator.", ex);
}
}
}
代码示例来源:origin: de.taimos/dvalin-jaxrs
public static ObjectMapper createDefaultYaml() {
YAMLFactory factory = new YAMLFactory();
factory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
factory.enable(YAMLGenerator.Feature.MINIMIZE_QUOTES);
factory.enable(YAMLGenerator.Feature.SPLIT_LINES);
factory.enable(YAMLGenerator.Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS);
ObjectMapper m = new ObjectMapper(factory);
m.registerModule(new JodaModule());
m.registerModule(new GuavaModule());
m.setSerializationInclusion(Include.NON_NULL);
m.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
m.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
m.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
m.enable(MapperFeature.AUTO_DETECT_GETTERS);
return m;
}
代码示例来源:origin: io.swagger.core.v3/swagger-core
protected static ObjectMapper createYaml() {
YAMLFactory factory = new YAMLFactory();
factory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
factory.enable(YAMLGenerator.Feature.MINIMIZE_QUOTES);
factory.enable(YAMLGenerator.Feature.SPLIT_LINES);
factory.enable(YAMLGenerator.Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS);
return create(factory);
}
代码示例来源:origin: com.atlassian.swagger/atlassian-swagger-doclet
protected static ObjectMapper createYaml() {
YAMLFactory factory = new YAMLFactory();
factory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
factory.enable(YAMLGenerator.Feature.MINIMIZE_QUOTES);
factory.enable(YAMLGenerator.Feature.SPLIT_LINES);
factory.enable(YAMLGenerator.Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS);
return create(factory);
}
内容来源于网络,如有侵权,请联系作者删除!