本文整理汇总了Java中org.codehaus.jackson.node.ObjectNode.get方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectNode.get方法的具体用法?Java ObjectNode.get怎么用?Java ObjectNode.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jackson.node.ObjectNode
的用法示例。
在下文中一共展示了ObjectNode.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCriteria
import org.codehaus.jackson.node.ObjectNode; //导入方法依赖的package包/类
public static Criteria getCriteria(ObjectNode rudeCriteria) throws Exception {
Criteria criteria = new Criteria();
if (rudeCriteria.has("criterions")) {
ArrayNode criterions = (ArrayNode) rudeCriteria.get("criterions");
if (criterions != null) {
for (Iterator<JsonNode> it = criterions.iterator(); it.hasNext();) {
criteria.addCriterion(parseCriterion((ObjectNode) it.next()));
}
}
}
if (rudeCriteria.has("orders")) {
ArrayNode orders = (ArrayNode) rudeCriteria.get("orders");
if (orders != null) {
for (Iterator<JsonNode> it = orders.iterator(); it.hasNext();) {
ObjectNode rudeCriterion = (ObjectNode) it.next();
Order order = new Order(JsonUtils.getString(rudeCriterion, "property"), JsonUtils.getBoolean(rudeCriterion, "desc"));
criteria.addOrder(order);
}
}
}
return criteria;
}
示例2: parseCriterion
import org.codehaus.jackson.node.ObjectNode; //导入方法依赖的package包/类
private static Criterion parseCriterion(ObjectNode rudeCriterion) throws Exception {
String junction = JsonUtils.getString(rudeCriterion, "junction");
if (StringUtils.isNotEmpty(junction)) {
Junction junctionCrition;
if ("or".equals(junction)) {
junctionCrition = new Or();
} else {
junctionCrition = new And();
}
ArrayNode criterions = (ArrayNode) rudeCriterion.get("criterions");
if (criterions != null) {
for (Iterator<JsonNode> it = criterions.iterator(); it.hasNext();) {
junctionCrition.addCriterion(parseCriterion((ObjectNode) it.next()));
}
}
return junctionCrition;
} else {
String property = JsonUtils.getString(rudeCriterion, "property");
String expression = JsonUtils.getString(rudeCriterion, "expression");
String dataTypeName = JsonUtils.getString(rudeCriterion, "dataType");
DataType dataType = null;
ViewManager viewManager = ViewManager.getInstance();
if (StringUtils.isNotEmpty(dataTypeName)) {
dataType = viewManager.getDataType(dataTypeName);
}
return viewManager.getFilterCriterionParser().createFilterCriterion(property, dataType, expression);
}
}
示例3: toStringList
import org.codehaus.jackson.node.ObjectNode; //导入方法依赖的package包/类
protected List<String> toStringList(ObjectNode result) {
if (result == null) {
return Collections.emptyList();
}
JsonNode jsonNode = result.get(K_OUTPUT);
if (jsonNode == null) {
return Collections.emptyList();
}
return StreamSupport.stream(jsonNode.spliterator(), false)
.map(JsonNode::asText)
.collect(Collectors.toList());
}
示例4: isValidJsonUser
import org.codehaus.jackson.node.ObjectNode; //导入方法依赖的package包/类
@Override
protected boolean isValidJsonUser(ObjectNode jsonUser) {
JsonNode userFound = jsonUser.get(JSON_PARAM_USER_FOUND);
return userFound != null && userFound.asBoolean();
}