Package org.xbill.DNS.utils.json.exception

Examples of org.xbill.DNS.utils.json.exception.JsonDeserializationException


        return getAddressFromString(addressNode.textValue());
      } else {
        return null;
      }
    } catch (final Throwable e) {
      throw new JsonDeserializationException(
          JsonDeserializationExceptionCode.invalidFieldValue, e,
          fieldName, getTextualBeanType(), e.getMessage());
    }
  }
View Full Code Here


                return getURLFromString(addressNode.textValue());
            } else {
                return null;
            }
        } catch (final Throwable e) {
            throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.invalidFieldValue, e,
                    fieldName, getTextualBeanType(), e.getMessage());
        }
    }
View Full Code Here

                return new TXTRecord(name, dclass, ttl, strings);
            }
        } catch (final JsonDeserializationException e) {
            throw e;
    } catch (final Exception e) {
      throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.unexpectedMappingError,
          e, getTextualBeanType(), e.getMessage());
    }
  }
View Full Code Here

    }
  }

    private void checkStringIsASCII(String string) {
        if (!CharMatcher.ASCII.matchesAllOf(string)) {
            throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.invalidFieldValue,
                    "strings", getTextualBeanType(), "Non-ASCII character found");
        }
    }
View Full Code Here

            return new DNSKEYRecord(name, dclass, ttl, getNodeIntegerValue(
                    recordNode, "flags"), getNodeIntegerValue(recordNode,
                    "protocol"), getNodeIntegerValue(recordNode, "algorithm"),
                    getNodeStringValue(recordNode, "key"));
        } catch (final IOException e) {
            throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.unexpectedMappingError,
                    e, getTextualBeanType(), e.getMessage());
        }
    }
View Full Code Here

                return new SPFRecord(name, dclass, ttl, strings);
            }
        } catch (final JsonDeserializationException e) {
            throw e;
        } catch (final Exception e) {
            throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.unexpectedMappingError,
                    e, getTextualBeanType(), e.getMessage());
        }
    }
View Full Code Here

        }
    }

    private void checkStringIsASCII(String string) {
        if (!CharMatcher.ASCII.matchesAllOf(string)) {
            throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.invalidFieldValue,
                    "strings", getTextualBeanType(), "Non-ASCII character found");
        }
    }
View Full Code Here

    }
    final String recordType = recordTypeNode.textValue();
    final Class<? extends Record> recordClass = recordClassesRegistry
        .get(recordType);
    if (recordClass == null) {
      throw new JsonDeserializationException(
                    JsonDeserializationExceptionCode.unknownResourceRecordType,
          recordType);
    }
    return reader.withType(recordClass).readValue(recordNode.toString());
  }
View Full Code Here

     */
  protected JsonNode findFieldNode(final ObjectNode recordNode,
      final String fieldName) {
    final JsonNode fieldNode = recordNode.get(fieldName);
    if (fieldNode == null) {
      throw new JsonDeserializationException(
          JsonDeserializationExceptionCode.missingField,
          fieldName, getTextualBeanType());
    }
    return fieldNode;
  }
View Full Code Here

  protected Name getNodeNameValue(final ObjectNode recordNode,
      final String fieldName) {
    try {
      return getNameFromString(getNodeStringValue(recordNode, fieldName));
    } catch (final TextParseException e) {
      throw new JsonDeserializationException(
          JsonDeserializationExceptionCode.invalidFieldValue, e,
          fieldName, getTextualBeanType(), e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.xbill.DNS.utils.json.exception.JsonDeserializationException

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.