Examples of JsonDeserializationException


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

                return fieldNode.booleanValue();
            case STRING:
                return Boolean.valueOf(
                        fieldNode.textValue());
            default:
                throw new JsonDeserializationException(
                        JsonDeserializationExceptionCode.invalidFieldValue,
                        fieldName, getTextualBeanType(), "Field cannot be read as a boolean");
        }
  }
View Full Code Here

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

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

                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

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

                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

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

    }
  }

    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

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

            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

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

                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

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

        }
    }

    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

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

    }
    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

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

     */
  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
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.