当前位置: 首页>>代码示例>>Java>>正文


Java JsonParser.Feature方法代码示例

本文整理汇总了Java中com.fasterxml.jackson.core.JsonParser.Feature方法的典型用法代码示例。如果您正苦于以下问题:Java JsonParser.Feature方法的具体用法?Java JsonParser.Feature怎么用?Java JsonParser.Feature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.fasterxml.jackson.core.JsonParser的用法示例。


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

示例1: configureFeature

import com.fasterxml.jackson.core.JsonParser; //导入方法依赖的package包/类
private void configureFeature(ObjectMapper objectMapper, Object feature, boolean enabled) {
	if (feature instanceof JsonParser.Feature) {
		objectMapper.configure((JsonParser.Feature) feature, enabled);
	}
	else if (feature instanceof JsonGenerator.Feature) {
		objectMapper.configure((JsonGenerator.Feature) feature, enabled);
	}
	else if (feature instanceof SerializationFeature) {
		objectMapper.configure((SerializationFeature) feature, enabled);
	}
	else if (feature instanceof DeserializationFeature) {
		objectMapper.configure((DeserializationFeature) feature, enabled);
	}
	else if (feature instanceof MapperFeature) {
		objectMapper.configure((MapperFeature) feature, enabled);
	}
	else {
		throw new FatalBeanException("Unknown feature class: " + feature.getClass().getName());
	}
}
 
开发者ID:JetBrains,项目名称:teamcity-hashicorp-vault-plugin,代码行数:21,代码来源:Jackson2ObjectMapperBuilder.java

示例2: configureFeature

import com.fasterxml.jackson.core.JsonParser; //导入方法依赖的package包/类
private void configureFeature(Object feature, boolean enabled) {
	if (feature instanceof JsonParser.Feature) {
		this.objectMapper.configure((JsonParser.Feature) feature, enabled);
	}
	else if (feature instanceof JsonGenerator.Feature) {
		this.objectMapper.configure((JsonGenerator.Feature) feature, enabled);
	}
	else if (feature instanceof SerializationFeature) {
		this.objectMapper.configure((SerializationFeature) feature, enabled);
	}
	else if (feature instanceof DeserializationFeature) {
		this.objectMapper.configure((DeserializationFeature) feature, enabled);
	}
	else if (feature instanceof MapperFeature) {
		this.objectMapper.configure((MapperFeature) feature, enabled);
	}
	else {
		throw new FatalBeanException("Unknown feature class: " + feature.getClass().getName());
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:Jackson2ObjectMapperFactoryBean.java

示例3: AsyncMissingValuesInObjectTest

import com.fasterxml.jackson.core.JsonParser; //导入方法依赖的package包/类
public AsyncMissingValuesInObjectTest(Collection<JsonParser.Feature> features) {
    this.factory = new JsonFactory();
    this.features = new HashSet<JsonParser.Feature>(features);

    for (JsonParser.Feature feature : features) {
        factory.enable(feature);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:AsyncMissingValuesInObjectTest.java

示例4: getTestCases

import com.fasterxml.jackson.core.JsonParser; //导入方法依赖的package包/类
@Parameterized.Parameters(name = "Features {0}")
public static Collection<EnumSet<JsonParser.Feature>> getTestCases()
{
    List<EnumSet<JsonParser.Feature>> cases = new ArrayList<EnumSet<JsonParser.Feature>>();
    cases.add(EnumSet.noneOf(JsonParser.Feature.class));
    cases.add(EnumSet.of(Feature.ALLOW_MISSING_VALUES));
    cases.add(EnumSet.of(Feature.ALLOW_TRAILING_COMMA));
    cases.add(EnumSet.of(Feature.ALLOW_MISSING_VALUES, Feature.ALLOW_TRAILING_COMMA));
    return cases;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:AsyncMissingValuesInObjectTest.java

示例5: create

import com.fasterxml.jackson.core.JsonParser; //导入方法依赖的package包/类
public static JsonParserFeatureFlag create(JsonParser.Feature feature, Boolean isEnabled) {
  return new AutoValue_JsonParserFeatureFlag(feature, isEnabled);
}
 
开发者ID:cerner,项目名称:beadledom,代码行数:4,代码来源:JsonParserFeatureFlag.java

示例6: feature

import com.fasterxml.jackson.core.JsonParser; //导入方法依赖的package包/类
public abstract JsonParser.Feature feature(); 
开发者ID:cerner,项目名称:beadledom,代码行数:2,代码来源:JsonParserFeatureFlag.java


注:本文中的com.fasterxml.jackson.core.JsonParser.Feature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。