List of usage examples for com.fasterxml.jackson.databind JsonNode textValue
public String textValue()
From source file:com.github.fge.jsonschema.keyword.validator.draftv4.RequiredKeywordValidator.java
public RequiredKeywordValidator(final JsonNode digest) { super("required"); final ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (final JsonNode element : digest.get(keyword)) builder.add(element.textValue()); required = builder.build();/*from ww w . j a va2 s .c o m*/ }
From source file:com.github.fge.jsonschema.keyword.validator.draftv3.PropertiesValidator.java
public PropertiesValidator(final JsonNode digest) { super("properties"); final ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (final JsonNode element : digest.get("required")) builder.add(element.textValue()); required = builder.build();//from w w w . ja v a 2 s . c om }
From source file:com.github.fge.jsonschema.keyword.validator.draftv4.DraftV4TypeValidator.java
public DraftV4TypeValidator(final JsonNode digest) { super("type"); for (final JsonNode node : digest.get(keyword)) types.add(NodeType.fromName(node.textValue())); }
From source file:com.github.fge.jsonschema.keyword.digest.draftv4.RequiredDigester.java
@Override public JsonNode digest(final JsonNode schema) { final ObjectNode ret = FACTORY.objectNode(); final ArrayNode required = FACTORY.arrayNode(); ret.put(keyword, required);/*w w w . j a v a 2 s. c o m*/ final List<JsonNode> list = Lists.newArrayList(schema.get(keyword)); Collections.sort(list, new Comparator<JsonNode>() { @Override public int compare(final JsonNode o1, final JsonNode o2) { return o1.textValue().compareTo(o2.textValue()); } }); required.addAll(list); return ret; }
From source file:com.github.fge.jsonschema.keyword.validator.helpers.DraftV3TypeKeywordValidator.java
protected DraftV3TypeKeywordValidator(final String keyword, final JsonNode digested) { super(keyword); for (final JsonNode element : digested.get(keyword)) types.add(NodeType.fromName(element.textValue())); for (final JsonNode element : digested.get("schemas")) schemas.add(element.intValue()); }
From source file:com.sqs.tq.fdc.PlainTextReporter.java
@Override public void report(ObjectNode reportData) { out.println();/* w ww.j a v a 2s. co m*/ out.println(String.format("File variants of '%s'", reportData.get("name").textValue())); out.println("---------------------------------------------------"); int idx = 1; for (JsonNode group : (ArrayNode) reportData.get("groups")) { String hash = group.get("hash").textValue(); ArrayNode files = (ArrayNode) group.get("files"); out.println(String.format("%d) #%d times (md5: %s)", idx, files.size(), hash)); for (JsonNode fd : files) { out.println(String.format(" %s", fd.textValue())); } ++idx; } }
From source file:org.eel.kitchen.jsonschema.format.AbstractDateFormatAttribute.java
@Override public final void checkValue(final String fmt, final ValidationContext ctx, final ValidationReport report, final JsonNode instance) { try {/* ww w . j a v a2 s .co m*/ dtf.parseDateTime(instance.textValue()); } catch (IllegalArgumentException ignored) { final Message.Builder msg = newMsg(fmt).setMessage(errmsg).addInfo("value", instance); report.addMessage(msg.build()); } }
From source file:com.github.fge.jsonschema.format.common.IPv6Attribute.java
@Override public void validate(final ProcessingReport report, final MessageBundle bundle, final FullData data) throws ProcessingException { final JsonNode instance = data.getInstance().getNode(); final String ipaddr = instance.textValue(); if (InetAddresses.isInetAddress(ipaddr) && InetAddresses.forString(ipaddr).getAddress().length == IPV6_LENGTH) return;//from w w w. j a va 2s .c o m report.error(newMsg(data, bundle, "err.format.invalidIPV6Address").putArgument("value", ipaddr)); }
From source file:com.github.fge.jsonschema.processors.validation.ObjectSchemaSelector.java
public ObjectSchemaSelector(final JsonNode digest) { hasAdditional = digest.get("hasAdditional").booleanValue(); List<String> list; list = Lists.newArrayList();// ww w . j a va 2s .co m for (final JsonNode node : digest.get("properties")) list.add(node.textValue()); properties = ImmutableList.copyOf(list); list = Lists.newArrayList(); for (final JsonNode node : digest.get("patternProperties")) list.add(node.textValue()); patternProperties = ImmutableList.copyOf(list); }
From source file:com.wealdtech.jackson.modules.LocalDateTimeDeserializer.java
@Override public LocalDateTime deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException { final ObjectCodec oc = jsonParser.getCodec(); final JsonNode node = oc.readTree(jsonParser); try {//www .j a v a 2 s .com return formatter.parseDateTime(node.textValue()).withZone(DateTimeZone.UTC).toLocalDateTime(); } catch (IllegalArgumentException iae) { LOGGER.warn("Attempt to deserialize invalid localdatetime {}", node.textValue()); throw new IOException("Invalid localdatetime value \"" + node.textValue() + "\"", iae); } }