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


Java ObjectNode.putNull方法代码示例

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


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

示例1: addField

import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
public static void addField(String dbName, String fieldName) throws Exception{
	ObjectMapper mapper = new ObjectMapper();
	//	ObjectNode mainNode = mapper.createObjectNode();
	ObjectNode childNode = mapper.createObjectNode();
	ArrayNode arrNode = mapper.createArrayNode();
	ObjectNode childNodeObject = mapper.createObjectNode();
	childNodeObject.put( "field-name", fieldName);
	childNodeObject.put( "include-root", true);
	childNodeObject.putNull( "included-elements");
	childNodeObject.putNull( "excluded-elements");
	childNodeObject.putNull( "tokenizer-overrides");
	arrNode.add(childNodeObject);
	childNode.putArray("field").addAll(arrNode);
	//		mainNode.put("fields", childNode);
	// 		   System.out.println("Entered field to make it true");
	setDatabaseProperties(dbName,"field",childNode);

}
 
开发者ID:marklogic,项目名称:marklogic-rdf4j,代码行数:19,代码来源:ConnectedRESTQA.java

示例2: addFieldExcludeRoot

import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
public static void addFieldExcludeRoot(String dbName, String fieldName) throws Exception{
	ObjectMapper mapper = new ObjectMapper();
	//			ObjectNode mainNode = mapper.createObjectNode();
	ObjectNode childNode = mapper.createObjectNode();
	ArrayNode arrNode = mapper.createArrayNode();
	ObjectNode childNodeObject = mapper.createObjectNode();
	childNodeObject.put( "field-name", fieldName);
	childNodeObject.put( "include-root", false);
	childNodeObject.putNull( "included-elements");
	childNodeObject.putNull( "excluded-elements");
	childNodeObject.putNull( "tokenizer-overrides");
	arrNode.add(childNodeObject);
	childNode.putArray("field").addAll(arrNode);
	//			mainNode.put("fields", childNode);
	//			System.out.println( childNode.toString());
	setDatabaseProperties(dbName,"field",childNode);

}
 
开发者ID:marklogic,项目名称:marklogic-rdf4j,代码行数:19,代码来源:ConnectedRESTQA.java

示例3: datumWithNullValue

import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@Test(expected = JasvornoConverterException.class)
public void datumWithNullValue() throws JsonProcessingException, IOException {
  Schema schema = SchemaBuilder.builder().record("record").fields().requiredString("name").endRecord();
  ObjectMapper mapper = new ObjectMapper();
  ObjectNode dataTable = mapper.createObjectNode();
  JsonNode datum = dataTable.putNull("name");
  JasvornoConverter.convertToAvro(model, datum, schema, UndeclaredFieldBehaviour.IGNORE);
}
 
开发者ID:HotelsDotCom,项目名称:jasvorno,代码行数:9,代码来源:JasvornoConverterTest.java

示例4: matchMapValueofNullDatum

import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@Test
public void matchMapValueofNullDatum() throws JsonProcessingException, IOException {
  Schema schema = SchemaBuilder.builder().map().values().nullType();
  ObjectMapper mapper = new ObjectMapper();
  ObjectNode dataTable = mapper.createObjectNode();
  JsonNode datum = dataTable.putNull("field1");
  MatchType matchType = new JasvornoConverter(model, UndeclaredFieldBehaviour.NO_MATCH).matchMapValue(datum, schema);
  assertThat(matchType, is(MatchType.FULL));
}
 
开发者ID:HotelsDotCom,项目名称:jasvorno,代码行数:10,代码来源:JasvornoConverterTest.java


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