Package com.github.fge.jackson

Examples of com.github.fge.jackson.NodeType


        return message.getMessage();
    }

    private static Object valueToArgument(final JsonNode value)
    {
        final NodeType type = NodeType.getNodeType(value);

        switch (type) {
            case STRING:
                return value.textValue();
            case INTEGER:
View Full Code Here


        return message.getMessage();
    }

    private static Object valueToArgument(final JsonNode value)
    {
        final NodeType type = NodeType.getNodeType(value);

        switch (type) {
            case STRING:
                return value.textValue();
            case INTEGER:
View Full Code Here

    @Test(dataProvider = "sampleData")
    public void onlyRelevantDigestsAreBuilt(final JsonNode node)
        throws ProcessingException
    {
        final NodeType type = NodeType.getNodeType(node);
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final SchemaContext context = new SchemaContext(tree, type);
        final ProcessingReport report = mock(ProcessingReport.class);
View Full Code Here

            if (size == 0) {
                report.error(newMsg(tree, bundle, "emptyArray"));
                return;
            }

            NodeType type;
            JsonNode element;
            boolean uniqueItems = true;

            final Set<JsonNode> set = Sets.newHashSet();
View Full Code Here

        return message.getMessage();
    }

    private static Object valueToArgument(final JsonNode value)
    {
        final NodeType type = NodeType.getNodeType(value);

        switch (type) {
            case STRING:
                return value.textValue();
            case INTEGER:
View Full Code Here

            if (size == 0) {
                report.error(newMsg(tree, bundle, "emptyArray"));
                return;
            }

            NodeType type;
            JsonNode element;
            boolean uniqueItems = true;

            final Set<JsonNode> set = Sets.newHashSet();
View Full Code Here

        final ProcessingReport report, final MessageBundle bundle,
        final FullData data)
        throws ProcessingException
    {
        final JsonNode instance = data.getInstance().getNode();
        final NodeType type = NodeType.getNodeType(instance);

        if (types.contains(type)) {
            report.error(newMsg(data, bundle, "err.draftv3.disallow.type")
                .putArgument("found", type)
                .putArgument("disallowed", toArrayNode(types)));
View Full Code Here

        final Map<String, JsonNode> map
            = JacksonUtils.asMap(schema.get(keyword));

        String key;
        JsonNode value;
        NodeType type;

        for (final Map.Entry<String, JsonNode> entry: map.entrySet()) {
            key = entry.getKey();
            value = entry.getValue();
            type = NodeType.getNodeType(value);
View Full Code Here

    public SchemaDigest process(final ProcessingReport report,
        final SchemaContext input)
        throws ProcessingException
    {
        final JsonNode schema = input.getSchema().getNode();
        final NodeType type = input.getInstanceType();
        final Map<String, JsonNode> map = Maps.newHashMap(buildDigests(schema));
        map.keySet().retainAll(typeMap.get(type));
        return new SchemaDigest(input, map);
    }
View Full Code Here

                .setMessage(bundle.getMessage("warn.format.notSupported"))
                .putArgument("attribute", fmt));
            return input;
        }

        final NodeType type = context.getInstanceType();

        if (!attr.supportedTypes().contains(type))
            return input;

        final List<KeywordValidator> validators = Lists.newArrayList(input);
View Full Code Here

TOP

Related Classes of com.github.fge.jackson.NodeType

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.