Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.fields()


    final JsonNode contactNode = node.get(Constants.CONTACT);
    if (contactNode != null) {
      final Map<String, String> m = new HashMap<String, String>(contactNode.size());

            final Iterator<Entry<String, JsonNode>> fieldIterator = contactNode.fields();
      while (fieldIterator.hasNext()) {
        final Map.Entry<String, JsonNode> entry = fieldIterator.next();
        m.put(entry.getKey(), entry.getValue().asText());
      }
      this.contact = m;
View Full Code Here


      List<KrakenPublicTrade> krakenTrades = new ArrayList<KrakenPublicTrade>();
      long last = 0;
      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      Iterator<Entry<String, JsonNode>> tradesResultIterator = node.fields();
      while (tradesResultIterator.hasNext()) {
        Entry<String, JsonNode> entry = tradesResultIterator.next();
        String key = entry.getKey();
        JsonNode value = entry.getValue();
        if (key == "last") {
View Full Code Here

      List<KrakenSpread> krakenTrades = new ArrayList<KrakenSpread>();
      long last = 0;
      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      Iterator<Entry<String, JsonNode>> tradesResultIterator = node.fields();
      while (tradesResultIterator.hasNext()) {
        Entry<String, JsonNode> entry = tradesResultIterator.next();
        String key = entry.getKey();
        JsonNode value = entry.getValue();
        if (key == "last") {
View Full Code Here

      Map<CurrencyPair, BTERTicker> tickerMap = new HashMap<CurrencyPair, BTERTicker>();
      ObjectCodec oc = jp.getCodec();
      JsonNode node = oc.readTree(jp);
      if (node.isObject()) {

        Iterator<Entry<String, JsonNode>> tickerEntryIter = node.fields();
        while (tickerEntryIter.hasNext()) {
          Entry<String, JsonNode> tickerEntryNode = tickerEntryIter.next();

          String pairString = tickerEntryNode.getKey();
          CurrencyPair pair = BTERAdapters.adaptCurrencyPair(pairString);
View Full Code Here

    @Override
    protected void _depositSchemaProperty(ObjectNode propertiesNode, JsonNode schemaNode)
    {
        JsonNode props = schemaNode.get("properties");
        if (props != null) {
            Iterator<Entry<String, JsonNode>> it = props.fields();
            while (it.hasNext()) {
                Entry<String,JsonNode> entry = it.next();
                String name = entry.getKey();
                if (_nameTransformer != null) {
                    name = _nameTransformer.transform(name);
View Full Code Here

                JsonNode content = entry.getValue();
                String id = entry.getKey();
                Map<String, String> entryMetadata = new HashMap<>();

                // We then iterate over all the key-value pairs present in the children node, and store them.
                for (Iterator<Map.Entry<String, JsonNode>> properties = content.fields();
                     properties.hasNext(); ) {
                    Map.Entry<String, JsonNode> property = properties.next();
                    String entryName = property.getKey();
                    JsonNode entryValueNode = property.getValue();
View Full Code Here

                        entryMetadata.put(entryName, entryValue);
                    }

                    // We get environment variables from the metadata when we iterate over app.env
                    if (id.equals("app") && entryName.equals("env")) {
                        for (Iterator<Map.Entry<String, JsonNode>> envVariables = entryValueNode.fields();
                             envVariables.hasNext(); ) {
                            Map.Entry<String, JsonNode> envVariable = envVariables.next();
                            String envName = envVariable.getKey();
                            JsonNode envValue = envVariable.getValue();
                            if (envValue.isTextual()) {
View Full Code Here

         }catch(Exception e){
           if (Logger.isDebugEnabled()) Logger.debug ("Error parsong login_data field");
           if (Logger.isDebugEnabled()) Logger.debug (ExceptionUtils.getFullStackTrace(e));
           return badRequest("login_data field is not a valid json string");
         }
         Iterator<Entry<String, JsonNode>> it =loginInfo.fields();
         HashMap<String, Object> data = new HashMap<String, Object>();
         while (it.hasNext()){
           Entry<String, JsonNode> element = it.next();
           String key=element.getKey();
           Object value=element.getValue().asText();
View Full Code Here

      try{
        aclJson = mapper.readTree(aclJsonString);
      }catch(JsonProcessingException e){
        throw e;
      }
      Iterator<Entry<String, JsonNode>> itAction = aclJson.fields(); //read,update,delete
      while (itAction.hasNext()){
        Entry<String, JsonNode> nextAction = itAction.next();
        String action = nextAction.getKey();
        Permissions actionPermission = null;
        if (action.equalsIgnoreCase("read"))
View Full Code Here

            aclJson = mapper.readTree(aclJsonString);
          }catch(JsonProcessingException e){
            return status(CustomHttpCode.ACL_JSON_FIELD_MALFORMED.getBbCode(),"The 'acl' field is malformed");
          }
          /*check if the roles and users are valid*/
           Iterator<Entry<String, JsonNode>> it = aclJson.fields();
           while (it.hasNext()){
             //check for permission read/update/delete/all
             Entry<String, JsonNode> next = it.next();
             if (!PermissionsHelper.permissionsFromString.containsKey(next.getKey())){
               return status(CustomHttpCode.ACL_PERMISSION_UNKNOWN.getBbCode(),"The key '"+next.getKey()+"' is invalid. Valid ones are 'read','update','delete','all'");
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.