本文整理汇总了Java中com.fasterxml.jackson.databind.node.ObjectNode.putPOJO方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectNode.putPOJO方法的具体用法?Java ObjectNode.putPOJO怎么用?Java ObjectNode.putPOJO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.databind.node.ObjectNode
的用法示例。
在下文中一共展示了ObjectNode.putPOJO方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pathSearchByName
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@Override
public AlfredPath pathSearchByName(String path) throws PathNotFoundException {
logger.debug("Search path: {}", path);
final ObjectNode body = JsonNodeFactory.instance.objectNode();
final ObjectNode query = JsonNodeFactory.instance.objectNode();
query.put("path", path);
body.putPOJO("query", query);
final ResponseEntity<ObjectNode> objectNodeResponseEntity =
restTemplate.postForEntity(url + AlfredConstants.SEARCH, body, ObjectNode.class);
final AlfredPath alfredPath;
if (objectNodeResponseEntity.getStatusCode().equals(HttpStatus.OK)) {
final ObjectNode bodyResponse = objectNodeResponseEntity.getBody();
final String nodeRef = bodyResponse.get("noderefs").get(0).asText();
alfredPath = ()
-> name
-> type
-> new AlfredDocumentBuilderWithTNameAndNameAndTypeImpl(nodeReferenceBuilder, url, restTemplate, nodeRef, name, type);
logger.debug("Found: {}", nodeRef);
} else {
throw new PathNotFoundException(path, objectNodeResponseEntity.getStatusCode());
}
return alfredPath;
}
示例2: property
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@Override
public AlfredQuery property(String name, Range range) {
final ObjectNode propertyNode = AlfredCompositeQueryBuilderImpl.newNode();
final ObjectNode props = AlfredCompositeQueryBuilderImpl.newNode();
final ObjectNode r = AlfredCompositeQueryBuilderImpl.newNode();
props.put("name", name);
if (range instanceof RangeDate) {
r.put("start", ((RangeDate) range).getStart().toString());
r.put("end", ((RangeDate) range).getEnd().toString());
} else if (range instanceof RangeInt) {
r.put("start", ((RangeInt) range).getStart());
r.put("end", ((RangeInt) range).getEnd());
} else {
throw new IllegalArgumentException("Range inconnu!");
}
props.putPOJO("range", r);
propertyNode.putPOJO("property", props);
return new AlfredQueryImpl(propertyNode);
}
示例3: hostsForClusterInPackage
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@CsapDoc ( notes = "Gets hosts for specified {releasePackage}{cluster} in current lifecycle."
+ "eg. webServer-1 (current lc), or dev-webServer-1, stage-webServer-1, etc."
+ "For other lifecycles, prod-webServer-1, etc. To select all packages, pass\"{releasePackage}\"" )
@RequestMapping ( "/hosts/{releasePackage}/{cluster}" )
public JsonNode hostsForClusterInPackage (
@PathVariable ( "releasePackage" ) String releasePackage,
@PathVariable ( "cluster" ) String cluster ) {
logger.debug( "csapApp lifecycle is {}", Application.getCurrentLifeCycle() );
if ( releasePackage.equals( "{releasePackage}" ) ) {
releasePackage = Application.ALL_PACKAGES;
}
ReleasePackage requestedModel = application.getModel( releasePackage );
ObjectNode hostNode = jacksonMapper.createObjectNode();
logger.debug( "keys: {}", requestedModel.getLcGroupVerToHostMap().keySet().toString() );
String shortName = cluster.replaceAll( "-", "" );
if ( shortName.equals( "{cluster}" ) ) {
shortName = requestedModel.getLcGroupVerToHostMap().firstKey();
}
ArrayList<String> hosts = requestedModel.getLcGroupVerToHostMap().get( shortName );
if ( hosts == null && !shortName.startsWith( Application.getCurrentLifeCycle() ) ) {
shortName = Application.getCurrentLifeCycle() + shortName;
hosts = requestedModel.getLcGroupVerToHostMap().get( shortName );
}
hostNode.put( "releasePackage", releasePackage );
hostNode.put( "cluster", shortName );
hostNode.putPOJO( "hosts", hosts );
return hostNode;
}
示例4: getAllCategoryMission
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
private ObjectNode getAllCategoryMission() {
final ObjectNode body = JsonNodeFactory.instance.objectNode();
final ObjectNode query = JsonNodeFactory.instance.objectNode();
query.put("path", "/cm:categoryRoot/vdl:vdlmission/*");
body.putPOJO("query", query);
return body;
}
示例5: getAllCategoryMissionWithFacets
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
private ObjectNode getAllCategoryMissionWithFacets() {
final ObjectNode body = JsonNodeFactory.instance.objectNode();
final ObjectNode query = JsonNodeFactory.instance.objectNode();
query.put("path", "/cm:categoryRoot/vdl:vdlmission/*");
body.putPOJO("query", query);
final ObjectNode facets = JsonNodeFactory.instance.objectNode();
facets.put("enabled", true);
body.putPOJO("facets", facets);
return body;
}
示例6: getTenNodes
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
private ObjectNode getTenNodes() {
final ObjectNode body = JsonNodeFactory.instance.objectNode();
final ObjectNode query = JsonNodeFactory.instance.objectNode();
query.put("type", "{http://www.alfresco.org/model/content/1.0}content");
body.putPOJO("query", query);
final ObjectNode paging = JsonNodeFactory.instance.objectNode();
paging.put("limit", 10);
paging.put("skip", 0);
body.putPOJO("paging", paging);
final ObjectNode facets = JsonNodeFactory.instance.objectNode();
facets.put("enabled", false);
body.putPOJO("facets", facets);
return body;
}
示例7: generate
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@Override
public void generate(ObjectNode fieldFormDefinition, Field field) {
RadioBox annotation = field.getAnnotation(RadioBox.class);
fieldFormDefinition.put("key", field.getName());
fieldFormDefinition.put("readOnly", annotation.readOnly());
fieldFormDefinition.put("type", "radios");
JsonNode radioFieldFormDefinition = fieldFormDefinition;
ObjectMapper radioMapper = new ObjectMapper();
ArrayNode titlesMap = radioMapper.createArrayNode();
Map<String, String> map;
try {
map = (annotation.titleMap()).newInstance().getValues();
for (Map.Entry<String, String> iterator : map.entrySet()) {
ObjectNode entry = radioMapper.createObjectNode();
entry.put("name", iterator.getKey());
entry.putPOJO("value", iterator.getValue());
titlesMap.add(entry);
}
} catch (InstantiationException | IllegalAccessException e) {
ASFUILogger.getLogger().error(e.getMessage());
throw new RuntimeException(e);
}
((ObjectNode) radioFieldFormDefinition).set("titleMap", titlesMap);
}
示例8: display
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
protected void display(JsonNode keyNode,
Versioned<JsonNode> value) throws Exception {
if (value.getValue() == null) return;
ObjectNode n = mapper.createObjectNode();
n.putPOJO("key", keyNode);
n.putPOJO("value", value.getValue());
out.println(writer.writeValueAsString(n));
}
示例9: getNodeByUrl
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
private ObjectNode getNodeByUrl(String url) {
List<Post> posts = getPostList(url);
ObjectNode objectNode = JsonUtil.createObjectNode();
objectNode.put("count", posts.size());
objectNode.putPOJO("posts", posts);
objectNode.put("date", DateUtil.getDateNow());
return objectNode;
}
示例10: getHosts
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@RequestMapping ( value = "/getHosts" , produces = MediaType.APPLICATION_JSON_VALUE )
public ObjectNode getHosts (
@RequestParam ( value = "clusterName" , required = true ) String clusterName ) {
logger.debug( "clusterName: {} ", clusterName );
ObjectNode responseObject = jacksonMapper.createObjectNode();
responseObject.put( "cluster", clusterName );
responseObject.putArray( "hosts" );
responseObject.putPOJO( "hosts", csapApp.getMutableHostsInActivePackage( clusterName ) );
return responseObject;
}