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