/** * Returns an Object's value for a given key, handling any special keys like objectId. Also * handles dot-notation for traversing into objects. */ private static Object getValue(Object container, String key) throws ParseException { return getValue(container, key, 0); }
private static Object getValue(Object container, String key, int depth) throws ParseException { if (key.contains(".")) { String[] parts = key.split("\\.", 2); Object value = getValue(container, parts[0], depth + 1); return getValue(restFormat, parts[1], depth + 1); key)); return getValue(value, parts[1], depth + 1);