public static Map<String, Object> toHierarchicalMap(Props props) { Map<String, Object> propsMap = new HashMap<String, Object>(); propsMap.put("source", props.getSource()); propsMap.put("props", toStringMap(props, true)); if (props.getParent() != null) { propsMap.put("parent", toHierarchicalMap(props.getParent())); } return propsMap; }