Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.ObjectCodec


         */
        @Override
        public QueryFilter deserialize(JsonParser jp, DeserializationContext ctxt)
                throws IOException {

            ObjectCodec objectCodec = jp.getCodec();
            ObjectNode root = jp.readValueAsTree();

            // Check if it is a "RealFilter"
            JsonNode queryParam = root.get("queryParam");
            if ( queryParam != null && queryParam.isValueNode() ) {
View Full Code Here


    public static class LogicalFilter4Deserializer extends JsonDeserializer<LogicalFilter4> {

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

            ObjectCodec objectCodec = jp.getCodec();
            ObjectNode root = jp.readValueAsTree();

            // We assume it is a LogicalFilter
            Iterator<String> iter = root.fieldNames();
            String key = iter.next();
View Full Code Here

    public static class LogicalFilter4Deserializer extends JsonDeserializer<LogicalFilter3> {

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

            ObjectCodec objectCodec = jp.getCodec();
            ObjectNode root = jp.readValueAsTree();

            // We assume it is a LogicalFilter
            Iterator<String> iter = root.fieldNames();
            String key = iter.next();
View Full Code Here

    @Override
    public Link deserialize(JsonParser jsonParser,
                            DeserializationContext deserializationContext) throws IOException, JsonProcessingException {

        ObjectCodec oc = jsonParser.getCodec();
        JsonNode node = oc.readTree(jsonParser);
        String rel = node.fieldNames().next();
        String href = node.elements().next().get("href").textValue();


        return new Link(rel,href);
View Full Code Here

    @Override
    public Map<String, Object> deserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException
    {
        ObjectCodec oc = jp.getCodec();
        JsonNode node = oc.readTree(jp);
        Map<String, Object> metadata = unmarshal(node.fields(), new HashMap<String, Object>());
        Map<String, Object> json = new HashMap<>();
        json.put("metadata", metadata);
        return json;
    }
View Full Code Here

    public Money deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
      throws IOException {

  Money result = null;

  ObjectCodec oc = jsonParser.getCodec();
  JsonNode node = oc.readTree(jsonParser);

  String currency = null;
  String amount = null;
  Long cents = null;
View Full Code Here

public class CryptoTradePairsDeserializer extends JsonDeserializer<Map<CurrencyPair, CryptoTradePair>> {

  @Override
  public Map<CurrencyPair, CryptoTradePair> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {

    final ObjectCodec oc = jp.getCodec();
    final JsonNode rootNode = oc.readTree(jp);
    final ArrayNode currencyPairs = (ArrayNode) rootNode.path("currency_pairs");
    final ArrayNode securityPairs = (ArrayNode) rootNode.path("security_pairs");

    final Map<CurrencyPair, CryptoTradePair> pairs = new HashMap<CurrencyPair, CryptoTradePair>();
    for (JsonNode pairInfo : currencyPairs) {
View Full Code Here

  }

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

    final ObjectCodec oc = jp.getCodec();
    final JsonNode statusNode = oc.readTree(jp);
    final JsonNode pairDataNode = statusNode.path("data");

    return getPairFromJsonNode(pairDataNode, statusNode);
  }
View Full Code Here

  static class CexIOOpenOrdersDeserializer extends JsonDeserializer<CexIOOpenOrders> {

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

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

      final JsonNode errorNode = openOrdersNode.path("error");
      if (!errorNode.isMissingNode()) {
        final String errorText = errorNode.asText();
        if (errorText.equals("Invalid symbols pair")) {
View Full Code Here

  static class CryptoTradePublicOrderDeserializer extends JsonDeserializer<CryptoTradePublicOrder> {

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

      final ObjectCodec oc = jp.getCodec();
      final JsonNode node = oc.readTree(jp);
      final String priceString = node.path(0).asText();
      final String amountString = node.path(1).asText();

      return new CryptoTradePublicOrder(new BigDecimal(amountString), new BigDecimal(priceString));
    }
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.