Package com.fasterxml.jackson.databind

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


            for (int i = 0; i < size; i++) // node do not return java.lang.Iterable
            {
                JsonNode node = nodes.get(i);
                if (node.isValueNode())
                {
                    elements.add(node.asText());
                }
                else if (node.isNull())
                {
                    elements.add(NULL);
                }
View Full Code Here


                        for (int i = 0; i < rowsNode.size(); i++) {
                            JsonNode documentNode = rowsNode.get(i);

                            // Id
                            JsonNode idNode = documentNode.get("id");
                            String id = (idNode != null) ? idNode.asText() : null;

                            // Key
                            JsonNode keyNode = documentNode.get("key");
                            CouchJsonKey jsonKey = (keyNode != null) ? new CouchJsonKey(keyNode.asText()) : new CouchJsonKey();
View Full Code Here

                            JsonNode idNode = documentNode.get("id");
                            String id = (idNode != null) ? idNode.asText() : null;

                            // Key
                            JsonNode keyNode = documentNode.get("key");
                            CouchJsonKey jsonKey = (keyNode != null) ? new CouchJsonKey(keyNode.asText()) : new CouchJsonKey();

                            // Content may come from value or doc
                            JsonNode contentNode = documentNode.get("doc");
                            if (contentNode == null) {
                                contentNode = documentNode.get("value");
View Full Code Here

                                // Get the revision from within the content (may not always be there).
                                JsonNode revNode = contentNode.get("_rev");
                                if (revNode == null) {
                                    revNode = contentNode.get("rev");
                                }
                                revision = (revNode != null) ? revNode.asText() : null;
                            }

                            // Create the document
                            documentList.add(new TextDocument(
                                    id,
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");

                credentialsExpiration = DateUtils.parseISO8601Date(expiration);
            }
        } catch (JsonMappingException e) {
View Full Code Here

                             envVariables.hasNext(); ) {
                            Map.Entry<String, JsonNode> envVariable = envVariables.next();
                            String envName = envVariable.getKey();
                            JsonNode envValue = envVariable.getValue();
                            if (envValue.isTextual()) {
                                environment.put(envName, envValue.asText());
                            }
                        }
                    }
                }
View Full Code Here

                    String entryName = property.getKey();
                    JsonNode entryValueNode = property.getValue();

                    // We check if the entry is well-formed (i.e can be output to a String meaningfully).
                    if (entryValueNode.isTextual() || entryValueNode.isInt()) {
                        String entryValue = entryValueNode.asText();
                        entryMetadata.put(entryName, entryValue);
                    }

                    // We get environment variables from the metadata when we iterate over app.env
                    if (id.equals("app") && entryName.equals("env")) {
View Full Code Here

                    String entryName = property.getKey();
                    JsonNode entryValueNode = property.getValue();

                    // We check if the entry is well-formed (i.e can be output to a String meaningfully).
                    if (entryValueNode.isTextual() || entryValueNode.isInt()) {
                        String entryValue = entryValueNode.asText();
                        entryMetadata.put(entryName, entryValue);
                    }

                    // We get environment variables from the metadata when we iterate over app.env
                    if (id.equals("app") && entryName.equals("env")) {
View Full Code Here

                             envVariables.hasNext(); ) {
                            Map.Entry<String, JsonNode> envVariable = envVariables.next();
                            String envName = envVariable.getKey();
                            JsonNode envValue = envVariable.getValue();
                            if (envValue.isTextual()) {
                                environment.put(envName, envValue.asText());
                            }
                        }
                    }
                }
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.