當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。