Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.asText()


            tree = MAPPER.readTree(in);
            JsonNode pauseType = tree.get("pauseType");
            if (pauseType == null)
                throw new IllegalArgumentException(
                        "Unrecognized serialized state");
            type = pauseType.asText();
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }
        Class<?> clazz;
        if (PersistableDownload.TYPE.equals(type)) {
View Full Code Here


        JsonNode effect = jStatement.get(JsonDocumentFields.STATEMENT_EFFECT);
        if (!isNotNull(effect))
            return null;

        Statement statement = new Statement(Effect.valueOf(effect.asText()));

        JsonNode id = jStatement.get(JsonDocumentFields.STATEMENT_ID);
        if (isNotNull(id)) {
            statement.setId(id.asText());
        }
View Full Code Here

        Statement statement = new Statement(Effect.valueOf(effect.asText()));

        JsonNode id = jStatement.get(JsonDocumentFields.STATEMENT_ID);
        if (isNotNull(id)) {
            statement.setId(id.asText());
        }

        JsonNode actionNodes = jStatement.get(JsonDocumentFields.ACTION);
        if (isNotNull(actionNodes))
            statement.setActions(actionsOf(actionNodes));
View Full Code Here

                elements = fieldValue.elements();
                while (elements.hasNext()) {
                    values.add(elements.next().asText());
                }
            } else {
                values.add(fieldValue.asText());
            }
            conditions.add(new Condition().withType(conditionType)
                    .withConditionKey(field.getKey()).withValues(values));
        }
    }
View Full Code Here

                throw new AmazonClientException("Unable to load credentials.");
            }

            if (null != token) {
                credentials = new BasicSessionCredentials(accessKey.asText(),
                        secretKey.asText(), token.asText());
            } else {
                credentials = new BasicAWSCredentials(accessKey.asText(),
                        secretKey.asText());
            }
View Full Code Here

                /*
                 * TODO: The expiration string comes in a different format
                 * than what we deal with in other parts of the SDK, so we
                 * have to convert it to the ISO8601 syntax we expect.
                 */
                String expiration = expirationJsonNode.asText();
                expiration = expiration.replaceAll("\\+0000$", "Z");

                try {
                    credentialsExpiration = DateUtils.parseISO8601Date(expiration);
                } catch(Exception ex) {
View Full Code Here

        resource.withLink(rel, href, name, title, hreflang, profile);
    }

    String optionalNodeValueAsText(JsonNode node, String key) {
        JsonNode value = node.get(key);
        return value != null ? value.asText() : null;
    }

    private void readProperties(MutableRepresentation resource, JsonNode rootNode) {

        Iterator<String> fieldNames = rootNode.fieldNames();
View Full Code Here

        Iterator<String> fieldNames = rootNode.fieldNames();
        while (fieldNames.hasNext()) {
            String fieldName = fieldNames.next();
            if (!Support.RESERVED_JSON_PROPERTIES.contains(fieldName)) {
                JsonNode field = rootNode.get(fieldName);
                resource.withProperty(fieldName, field.isNull() ? null : field.asText());
            }
        }

    }
View Full Code Here

        }
        if( jsonNode.isNull() )
        {
            return null;
        }
        return jsonNode.asText();
    }

    @Override
    protected <T> Collection<T> readArrayInCollection( JsonParser input,
                                                       Function<JsonParser, T> deserializer,
View Full Code Here

            Class<?> clazz = Object.class;
            ObjectNode root = (ObjectNode) rootNode;
            JsonNode node = root.remove(configuration.getJsonTypeFieldName());
            if (node != null) {
                try {
                    String typeName = node.asText();
                    Class<?> supportClazz = Class.forName(typeName);
                    if (classes.contains(supportClazz)) {
                        clazz = supportClazz;
                    }
                } catch (ClassNotFoundException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.