Examples of DNSAPIClientJsonMappingException


Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

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

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

            case STRING:
                try {
                    return NumberFormat.getInstance(Locale.getDefault()).parse(
                        fieldNode.textValue());
                } catch (final ParseException e) {
                    throw new DNSAPIClientJsonMappingException(
                            DNSAPIClientJsonMappingExceptionCode.invalidFieldValue, e,
                            fieldName, getTextualBeanType(), e.getMessage());
                }
            default:
                throw new DNSAPIClientJsonMappingException(
                        DNSAPIClientJsonMappingExceptionCode.invalidFieldValue,
                        fieldName, getTextualBeanType(), "Field cannot be read as a number");
        }
  }
View Full Code Here

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

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

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

    public LocalDateTime getNodeLocalDateTimeValue(final ObjectNode recordNode,
                                                   final String fieldName) {
        try {
            return LocalDateTime.parse(getNodeStringValue(recordNode, fieldName));
        } catch (final Throwable e) {
            throw new DNSAPIClientJsonMappingException(
                    DNSAPIClientJsonMappingExceptionCode.invalidFieldValue, e,
                    fieldName, getTextualBeanType(), e.getMessage());
        }
    }
View Full Code Here

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

            if (nodeStringValue == null) {
                return null;
            }
            return LocalDateTime.parse(nodeStringValue);
        } catch (final Throwable e) {
            throw new DNSAPIClientJsonMappingException(
                    DNSAPIClientJsonMappingExceptionCode.invalidFieldValue, e,
                    fieldName, getTextualBeanType(), e.getMessage());
        }
    }
View Full Code Here

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

                return new DNSAPIClientJsonGenerationException(
                        DNSAPIClientJsonGenerationException.DNSAPIClientJsonGenerationExceptionCode.unexpectedGenerationError,
                        originalException.getMessage());
            } else if (JsonMappingException.class.isAssignableFrom(originalException.getClass())
                    || JsonParseException.class.isAssignableFrom(originalException.getClass())) {
                return new DNSAPIClientJsonMappingException(
                        DNSAPIClientJsonMappingException.DNSAPIClientJsonMappingExceptionCode.unexpectedMappingError,
                        "unknown", originalException.getMessage());
            } else {
                return originalException;
            }
View Full Code Here

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

        if (JsonSerializationException.class.isAssignableFrom(baseJsonException.getClass())) {
            return new DNSAPIClientJsonGenerationException(
                    DNSAPIClientJsonGenerationException.DNSAPIClientJsonGenerationExceptionCode.valueOf(
                            baseJsonException.getExceptionCode().name()), baseJsonException.getObjects());
        } else {
            return new DNSAPIClientJsonMappingException(
                    DNSAPIClientJsonMappingException.DNSAPIClientJsonMappingExceptionCode.valueOf(
                            baseJsonException.getExceptionCode().name()), baseJsonException.getObjects());
        }
    }
View Full Code Here

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

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

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

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

Examples of com.discoverydns.dnsapiclient.exception.DNSAPIClientJsonMappingException

      final String fieldName) {
    try {
      return NumberFormat.getInstance(Locale.getDefault()).parse(
          getNodeStringValue(recordNode, fieldName));
    } catch (final ParseException e) {
      throw new DNSAPIClientJsonMappingException(
          DNSAPIClientJsonMappingExceptionCode.invalidFieldValue, e,
          fieldName, getTextualBeanType(), e.getMessage());
    }
  }
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.