本文整理匯總了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();
}