Package com.fasterxml.jackson.databind

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


  protected Boolean getNodeBooleanValue(final ObjectNode recordNode,
      final String fieldName) {
        JsonNode fieldNode = findFieldNode(recordNode, fieldName);
        switch (fieldNode.getNodeType()) {
            case BOOLEAN:
                return fieldNode.booleanValue();
            case STRING:
                return Boolean.valueOf(
                        fieldNode.textValue());
            default:
                throw new JsonDeserializationException(
View Full Code Here


            }
            if (node != null) {
                if (node.isNumber()) {
                    return node.numberValue();
                } else if (node.isBoolean()) {
                    return node.booleanValue();
                } else if (node.isTextual()) {
                    return node.textValue();
                } else {
                    return node;
                }
View Full Code Here

           
        } else if (node.isTextual()) {
            return valueMatcher.matches(node.textValue());
           
        } else if (node.isBoolean()) {
            return valueMatcher.matches(node.booleanValue());
           
        } else if (node.isDouble()) {
            return valueMatcher.matches(node.doubleValue());
           
        } else if (node.isObject()) {
View Full Code Here

    public Boolean deserializeBoolean(JsonReadGenericRecord rec, String fieldName) {
        JsonReadGenericRecord record = (JsonReadGenericRecord) rec;
        JsonNode node = record.getNode().isBoolean() ? record.getNode() : getJsonNode(rec, fieldName);
        if (node == null)
            return null;
        return node.booleanValue();
    }

    @Override
    public Integer deserializeInteger(JsonReadGenericRecord record, String fieldName) {
        JsonNode node = record.getNode().isNumber() ? record.getNode() : getJsonNode(record, fieldName);
View Full Code Here

  protected Boolean getNodeBooleanValue(final ObjectNode recordNode,
      final String fieldName) {
        JsonNode fieldNode = findFieldNode(recordNode, fieldName);
        switch (fieldNode.getNodeType()) {
            case BOOLEAN:
                return fieldNode.booleanValue();
            case STRING:
                return Boolean.valueOf(
                        fieldNode.textValue());
            default:
                throw new JsonDeserializationException(
View Full Code Here

            result.setMaximum(maximum.decimalValue());
        }

        JsonNode exclusiveMinimum = rawSchema.get("exclusiveMinimum");
        if (exclusiveMinimum != null) {
            result.setExclusiveMinimum(exclusiveMinimum.booleanValue());
        }

        JsonNode exclusiveMaximum = rawSchema.get("exclusiveMaximum");
        if (exclusiveMaximum != null) {
            result.setExclusiveMaximum(exclusiveMaximum.booleanValue());
View Full Code Here

            result.setExclusiveMinimum(exclusiveMinimum.booleanValue());
        }

        JsonNode exclusiveMaximum = rawSchema.get("exclusiveMaximum");
        if (exclusiveMaximum != null) {
            result.setExclusiveMaximum(exclusiveMaximum.booleanValue());
        }

        JsonNode enumeration = rawSchema.get("enumeration");
        if (enumeration != null) {
            List<JsonNode> enumerationValues = new ArrayList<>();
View Full Code Here

            JsonNode nestedSchema = rawProperties.get(fieldName);
            property.setNestedSchema(parse(nestedSchema, schemaLocation));

            JsonNode required = nestedSchema.get("required");
            if (required != null) {
                property.setRequired(required.booleanValue());
            }
           
            schema.getProperties().add(property);
        }
    }
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.