Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.ObjectCodec


public class CoinbaseCentsDeserializer extends JsonDeserializer<CoinbaseMoney> {

  @Override
  public CoinbaseMoney deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

    final ObjectCodec oc = jp.getCodec();
    final JsonNode node = oc.readTree(jp);

    return getCoinbaseMoneyFromCents(node);
  }
View Full Code Here


  static class CoinbaseAddressesDeserializer extends JsonDeserializer<CoinbaseAddresses> {

    @Override
    public CoinbaseAddresses deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      final ObjectCodec oc = jp.getCodec();
      final JsonNode node = oc.readTree(jp);
      final JsonNode addressesArrayNode = node.path("addresses");

      final List<CoinbaseAddress> addresses = new ArrayList<CoinbaseAddress>();
      for (final JsonNode addressNode : addressesArrayNode) {
        addresses.add(getAddressFromNode(addressNode));
View Full Code Here

public class CoinbaseMoneyDeserializer extends JsonDeserializer<CoinbaseMoney> {

  @Override
  public CoinbaseMoney deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

    final ObjectCodec oc = jp.getCodec();
    final JsonNode node = oc.readTree(jp);

    return getCoinbaseMoneyFromNode(node);
  }
View Full Code Here

  static class CoinbaseCurrencyDeserializer extends JsonDeserializer<CoinbaseCurrency> {

    @Override
    public CoinbaseCurrency deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jp.getCodec();
      JsonNode node = oc.readTree(jp);
      if (node.isArray()) {
        String name = node.path(0).asText();
        String isoCode = node.path(1).asText();
        return new CoinbaseCurrency(name, isoCode);
      }
View Full Code Here

    private static final EnumFromStringHelper<CoinbaseTransferType> FROM_STRING_HELPER = new EnumFromStringHelper<CoinbaseTransferType>(CoinbaseTransferType.class);

    @Override
    public CoinbaseTransferType deserialize(final JsonParser jsonParser, final DeserializationContext ctxt) throws IOException, JsonProcessingException {

      final ObjectCodec oc = jsonParser.getCodec();
      final JsonNode node = oc.readTree(jsonParser);
      final String jsonString = node.textValue();
      return FROM_STRING_HELPER.fromJsonString(jsonString);
    }
View Full Code Here

  static class CoinbaseTransferDeserializer extends JsonDeserializer<CoinbaseTransfer> {

    @Override
    public CoinbaseTransfer deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      final ObjectCodec oc = jp.getCodec();
      final JsonNode node = oc.readTree(jp);

      final JsonNode successNode = node.path("success");
      boolean success = true;
      final List<String> errors = new ArrayList<String>();
      if (successNode.isBoolean()) {
View Full Code Here

  static class BitstampBooleanResponseDeserializer extends JsonDeserializer<BitstampBooleanResponse> {

    @Override
    public BitstampBooleanResponse deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      if (node.isBoolean()) {
        return new BitstampBooleanResponse(null, node.asBoolean());
      }
      else if (node.get("error") != null) {
        return new BitstampBooleanResponse(node.path("error").asText(), false);
View Full Code Here

  static class KrakenOrderFlagsDeserializer extends JsonDeserializer<Set<KrakenOrderFlags>> {

    @Override
    public Set<KrakenOrderFlags> deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      String orderFlagsString = node.textValue();
      Set<KrakenOrderFlags> orderFlags = EnumSet.noneOf(KrakenOrderFlags.class);
      if (!orderFlagsString.isEmpty()) {
        for (String orderFlag : orderFlagsString.split(","))
          orderFlags.add(fromString(orderFlag));
View Full Code Here

  static class KrakenTypeDeserializer extends JsonDeserializer<KrakenType> {

    @Override
    public KrakenType deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      String typeString = node.textValue();
      return fromString(typeString);
    }
View Full Code Here

    private static class HelloDeserializer extends JsonDeserializer<HelloMessageImpl> {

        @Override
        public HelloMessageImpl deserialize(final JsonParser jp, final DeserializationContext ctxt)
                throws IOException {
            final ObjectCodec oc = jp.getCodec();
            final JsonNode node = oc.readTree(jp);
            final JsonNode channelIdsNode = node.get(HelloMessage.CHANNEL_IDS_FIELD);
            final Set<String> channelIds = new HashSet<String>();
            if (channelIdsNode != null && channelIdsNode.isArray()) {
                for (JsonNode channelIdNode : channelIdsNode) {
                    channelIds.add(channelIdNode.asText());
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.core.ObjectCodec

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.