Package com.fasterxml.jackson.databind.node

Examples of com.fasterxml.jackson.databind.node.TextNode


        JsonToken curr = jp.getCurrentToken();

        if ((curr == JsonToken.VALUE_STRING) || (curr == JsonToken.FIELD_NAME)
            || (curr == JsonToken.VALUE_FALSE) || (curr == JsonToken.VALUE_TRUE)) {
            String name = jp.getText();
            TextNode upperName = ctxt.getNodeFactory().textNode(name.toUpperCase());

            JsonParser treeParser = jp.getCodec().treeAsTokens(upperName);
            treeParser.nextToken();
            return base.deserialize(treeParser, ctxt);
        } else {
View Full Code Here


    @Override
    public JsonSchema customize(JsonSchema originalSchema) {
        JsonSchema schema = super.customize(originalSchema);
//        schema.asObjectSchema().getProperties().get("SomeOtherProp").asStringSchema().setDefault("default-value");
        ((ObjectNode)schema.getSchemaNode().get("properties").get("SomeOtherProp")).set("default", new TextNode("default-value"));
        return schema;
    }
View Full Code Here

        String defaultServerUrl = System.getenv(OPENSHIFT_BROKER_HOST);
        if (defaultServerUrl == null || defaultServerUrl.trim().equals("")) {
            defaultServerUrl = "openshift.redhat.com";
        }
//        jsonSchema.asObjectSchema().getProperties().get("serverUrl").asStringSchema().setDefault(defaultServerUrl);
        ((ObjectNode)jsonSchema.getSchemaNode().get("properties").get("serverUrl")).set("default", new TextNode(defaultServerUrl));
        return jsonSchema;
    }
View Full Code Here

    for (Entry<String, List<String>> entry : entrySet) {
      String key = entry.getKey();
      JsonNode value = null;

      if (1 == entry.getValue().size()) {
        value = new TextNode(entry.getValue().get(0));
      } else {
        ArrayNode arrayNode = objectMapper.createArrayNode();

        for (String v : entry.getValue())
          arrayNode.add(v);
View Full Code Here

  public static String addTypeInformation( @Nonnull String type, @Nonnull Version version, @Nonnull byte[] xmlBytes ) throws Exception {
    JsonNode tree = new ObjectMapper().readTree( new String( xmlBytes, Charsets.UTF_8 ) );

    Map<String, JsonNode> newProps = new LinkedHashMap<String, JsonNode>();
    newProps.put( "@type", new TextNode( type ) );
    newProps.put( "@version", new TextNode( version.format() ) );

    Iterator<Map.Entry<String, JsonNode>> nodeIterator = tree.fields();
    while ( nodeIterator.hasNext() ) {
      Map.Entry<String, JsonNode> jsonNode = nodeIterator.next();
      newProps.put( jsonNode.getKey(), jsonNode.getValue() );
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.node.TextNode

Copyright © 2018 www.massapicom. 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.