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


Java ObjectNode.putPOJO方法代码示例

本文整理汇总了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;
}
 
开发者ID:avdyk,项目名称:be.liege.cti.ged,代码行数:24,代码来源:AlfredServiceImpl.java

示例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);
}
 
开发者ID:avdyk,项目名称:be.liege.cti.ged,代码行数:20,代码来源:AlfredCompositeQueryBuilderImpl.java

示例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;
}
 
开发者ID:csap-platform,项目名称:csap-core,代码行数:36,代码来源:ModelApi.java

示例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;
}
 
开发者ID:avdyk,项目名称:be.liege.cti.ged,代码行数:8,代码来源:SearchCategories.java

示例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;
}
 
开发者ID:avdyk,项目名称:be.liege.cti.ged,代码行数:11,代码来源:SearchCategories.java

示例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;
}
 
开发者ID:avdyk,项目名称:be.liege.cti.ged,代码行数:15,代码来源:SearchCategories.java

示例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);

}
 
开发者ID:JsonSchema-JavaUI,项目名称:sf-java-ui,代码行数:35,代码来源:RadioBoxGenerator.java

示例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));
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:9,代码来源:SyncClient.java

示例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;
}
 
开发者ID:r0n9,项目名称:demo-springboot,代码行数:10,代码来源:KdsCrawlerService.java

示例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;
}
 
开发者ID:csap-platform,项目名称:csap-core,代码行数:16,代码来源:HostRequests.java


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