Parse map.

@param context the context
@param parser the parser
@param map the map
@param skipRead the skip read
@return the map
344081
static Map<String, Object> parseMap(AbstractContext context, JsonParser parser, Map<String, Object> map, boolean skipRead) {
		try {
			String key;
			Object value;

			if (!skipRead) {
				parser.nextToken();
			}

			if (parser.currentToken() != JsonToken.START_OBJECT) {
				throw (new KriptonRuntimeException("Invalid input format"));
			}

			skipRead = false;

			do {

				if (skipRead) {
					key = parser.getCurrentName();
				} else {
					key = parser.nextFieldName();
					skipRead = true;
				}

				JsonToken token = parser.nextToken();
				switch (token) {
				case START_ARRAY:
					// parse array
					value = parseList(context, parser, new ArrayList<Object>(), true);
					break;
				case VALUE_EMBEDDED_OBJECT:
					// parse submap
					value = parseMap(context, parser, new LinkedHashMap<String, Object>(), true);
					break;
				default:
					// parser.nextValue();
					value = parser.getValueAsString();
				}
				// value = parser.getText();
				map.put(key, value);
			} while (parser.nextToken() != JsonToken.END_OBJECT);
			return map;
		} catch (IOException e) {
			e.printStackTrace();
			throw (new KriptonRuntimeException(e));
		}
	}
241397
static List<Object> parseList(AbstractContext context, JsonParser parser, List<Object> list, boolean skipRead) {
		try {
			if (!skipRead) {
				parser.nextToken();
			}

			if (parser.currentToken() != JsonToken.START_ARRAY) {
				throw (new KriptonRuntimeException("Invalid input format"));
			}

			skipRead = false;

			JsonToken token;
			do {
				if (skipRead) {
					token = parser.getCurrentToken();
				} else {
					token = parser.nextToken();
					skipRead = true;
				}
				switch (token) {
				case VALUE_FALSE:
				case VALUE_TRUE:
				case VALUE_NUMBER_FLOAT:
				case VALUE_NUMBER_INT:
				case VALUE_STRING:
					list.add(parser.getText());
					break;
				case VALUE_NULL:
					list.add(null);
					break;
				case VALUE_EMBEDDED_OBJECT:
					// parse submap
					list.add(parseMap(context, parser, new LinkedHashMap<String, Object>(), true));
					break;
				case START_ARRAY:
					list.add(parseList(context, parser, list, true));
					break;
				default:
					break;
				}
			} while (parser.nextToken() != JsonToken.END_ARRAY);
			return list;
		} catch (IOException e) {
			e.printStackTrace();
			throw (new KriptonRuntimeException(e));
		}
	}
565654
private Map<String, Object> parseObjectInternal() throws IOException {
		Map<String, Object> result = new HashMap<>();
		
		Type t;
		while (true) {
			t = lexer.readNextToken();
			if (t == Type.END_OBJECT) {
				break;
			}
			
			if (!result.isEmpty()) {
				//skip comma and read next token
				if (t != Type.COMMA) {
					throw new IOException("Unexpected token: " + t);
				}
				t = lexer.readNextToken();
			}
			
			//first token must be the name
			if (t != Type.STRING) {
				throw new IOException("Unexpected token: " + t);
			}
			String name = lexer.readString();
			
			//skip colon
			t = lexer.readNextToken();
			if (t != Type.COLON) {
				throw new IOException("Unexpected token: " + t);
			}
			
			//next token must be the value
			t = lexer.readNextToken();
			Object value = readValue(t);
			result.put(name, value);
		}
		
		return result;
	}
1194767
public <T> T parse(byte[] in, JsonReaderI<T> mapper) throws ParseException {
		this.base = mapper.base;
		this.in = in;
		this.len = in.length;
		return parse(mapper);
	}
365806
public Map<String, T> parseMap(InputStream is) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(is);
        jsonParser.nextToken();
        return parseMap(jsonParser);
    }
277144
public static PagingParams fromMap(AnyValueMap map) {
		Long skip = map.getAsNullableLong("skip");
		Long take = map.getAsNullableLong("take");
		boolean total = map.getAsBooleanWithDefault("total", true);
		return new PagingParams(skip, take, total);
	}
292273
public Map<String, T> parseMap(JsonParser jsonParser) throws IOException {
        HashMap<String, T> map = new HashMap<String, T>();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String key = jsonParser.getText();
            jsonParser.nextToken();
            if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) {
                map.put(key, null);
            } else{
                map.put(key, parse(jsonParser));
            }
        }
        return map;
    }
275882
public Map<String, String> parseSoapHeader(final Element soapHeader) {
		final NodeList tpicHeaders = soapHeader.getElementsByTagNameNS(TraceeConstants.SOAP_HEADER_NAMESPACE, TraceeConstants.TPIC_HEADER);
		final HashMap<String, String> contextMap = new HashMap<>();
		if (tpicHeaders != null && tpicHeaders.getLength() > 0) {
			final int items = tpicHeaders.getLength();
			for (int i = 0; i < items; i++) {
				contextMap.putAll(parseTpicHeader((Element) tpicHeaders.item(i)));
			}
		}
		return contextMap;
	}
1213836
@Override
  public void parse(String contents) throws SourceMapParseException {
    SourceMapObject sourceMapObject = SourceMapObjectParser.parse(contents);
    parse(sourceMapObject, null);
  }
1314306
private void parseSkipURL(String skipURL) {
		patternSkipURL = null;

		if (skipURL == null || skipURL.equals("")) {
			return;
		}

		skipURL = skipURL.replaceAll("\\.", "\\\\.");
		skipURL = skipURL.replaceAll("\\*", ".*?").replaceAll("(\\s+$)|(^\\s+)", "");
		skipURL = "\\A(" + skipURL.replaceAll("\\s+", "|") + ")";
		patternSkipURL = Pattern.compile(skipURL, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
	}
570128
public static Map<String, Map<String, String>> addContext(final String key, final Map<String, String> data,
                                                              final Map<String, Map<String, String>> context) {
        final Map<String, Map<String, String>> newdata = new HashMap<>();
        if (null != context) {
            newdata.putAll(context);
        }
        newdata.put(key, data);
        return newdata;
    }
758106
@Override
    public Map<String, String> getCopyOfContextMap() {
        Map<String, String> oldMap = inheritableThreadLocal.get();
        if (oldMap != null) {
            return new HashMap<>(oldMap);
        } else {
            return null;
        }
    }
629563
public static Map<String, String> performMapping(final Map<String, String> input,
                                                      final Map<String, String> mapping, final boolean skip) {

        final Map<String, String> props = new HashMap<String, String>();

        for (final Map.Entry<String, String> entry : input.entrySet()) {
            if (null != mapping.get(entry.getKey())) {
                props.put(mapping.get(entry.getKey()), entry.getValue());
            } else if(!skip) {
                props.put(entry.getKey(), entry.getValue());
            }

        }
        return props;
    }
1007550
public <T> T parse(Reader in, JsonReaderI<T> mapper) throws ParseException {
		this.base = mapper.base;
		//
		this.in = in;
		return super.parse(mapper);
	}
1052326
public Map<String, T> parseMap(byte[] byteArray) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(byteArray);
        jsonParser.nextToken();
        return parseMap(jsonParser);
    }
604764
@Override
  public Map<String, Object> parse(String input)
  {
    try {
      Map<String, Object> map = new LinkedHashMap<>();
      Map<String, Object> document = mapper.readValue(
          input,
          new TypeReference<Map<String, Object>>()
          {
          }
      );
      for (Map.Entry<String, Pair<FieldType, JsonPath>> entry : fieldPathMap.entrySet()) {
        String fieldName = entry.getKey();
        Pair<FieldType, JsonPath> pair = entry.getValue();
        JsonPath path = pair.rhs;
        Object parsedVal;
        if (pair.lhs == FieldType.ROOT) {
          parsedVal = document.get(fieldName);
        } else {
          parsedVal = path.read(document, jsonPathConfig);
        }
        if (parsedVal == null) {
          continue;
        }
        parsedVal = valueConversionFunction(parsedVal);
        map.put(fieldName, parsedVal);
      }
      if (useFieldDiscovery) {
        discoverFields(map, document);
      }
      return map;
    }
    catch (Exception e) {
      throw new ParseException(e, "Unable to parse row [%s]", input);
    }
  }
783813
def _parse(self, stream, context, path):
        """"""
        start = stream.tell()
        read_bytes = ""
        if self.max_length:
            read_bytes = stream.read(self.max_length)
        else:
            read_bytes = stream.read()
        skip = read_bytes.find(self.find) + len(self.find)
        stream.seek(start + skip)
        return skip