childValue = toList(child, singularName); } else { childValue = toMap(child);
private List<Object> toList(Xpp3Dom node, String childName) { List<Object> list = new ArrayList<>(); int n = node.getChildCount(); for (int i = 0; i < n; i++) { Xpp3Dom child = node.getChild(i); if (!childName.equals(child.getName())) { throw new YAMLException(format("child name: '%s' does not match expected name: '%s' at node %s", child.getName(), childName, node)); } Object childValue = child.getValue(); if (childValue == null) { childValue = toMap(child); } list.add(childValue); } return list; } }
childValue = toList(child, singularName); } else { childValue = toMap(child);
private Map<String, Object> toMap( Xpp3Dom dom ) { Map<String, Object> map = new LinkedHashMap<String, Object>(); int n = dom.getChildCount(); for ( int i = 0; i < n; i++ ) { Xpp3Dom child = dom.getChild( i ); if ( child.getValue() != null ) { map.put( child.getName(), child.getValue() ); } else { map.put( child.getName(), toMap( child ) ); } } return map; }
private Map<String, Object> toMap( Xpp3Dom dom ) { Map<String, Object> map = new LinkedHashMap<String, Object>(); int n = dom.getChildCount(); for ( int i = 0; i < n; i++ ) { Xpp3Dom child = dom.getChild( i ); if ( child.getValue() != null ) { map.put( child.getName(), child.getValue() ); } else { map.put( child.getName(), toMap( child ) ); } } return map; }
private List<Object> toList(Xpp3Dom node, String childName) { List<Object> list = new ArrayList<>(); int n = node.getChildCount(); for (int i = 0; i < n; i++) { Xpp3Dom child = node.getChild(i); if (!childName.equals(child.getName())) { throw new YAMLException(format("child name: '%s' does not match expected name: '%s' at node %s", child.getName(), childName, node)); } Object childValue = child.getValue(); if (childValue == null) { childValue = toMap(child); } list.add(childValue); } return list; } }
public Node representData(Object data) { return representMapping(Tag.MAP, toMap((Xpp3Dom) data), null); }
public Node representData( Object data ) { return representMapping( Tags.MAP, toMap( (Xpp3Dom) data ), null ); }
public Node representData( Object data ) { return representMapping( Tags.MAP, toMap( (Xpp3Dom) data ), null ); }
public Node representData(Object data) { return representMapping(Tag.MAP, toMap((Xpp3Dom) data), null); }