final protected Object newInstance(Class<?> ancestor, Node node) throws InstantiationException { return newInstance(ancestor, node, true); }
protected Object newInstance(Node node) { try { return newInstance(Object.class, node); } catch (InstantiationException e) { throw new YAMLException(e); } }
@SuppressWarnings("unchecked") protected Set<Object> newSet(CollectionNode<?> node) { try { return (Set<Object>) newInstance(Set.class, node); } catch (InstantiationException e) { return createDefaultSet(node.getValue().size()); } }
@SuppressWarnings("unchecked") protected List<Object> newList(SequenceNode node) { try { return (List<Object>) newInstance(List.class, node); } catch (InstantiationException e) { return createDefaultList(node.getValue().size()); } }
@SuppressWarnings("unchecked") protected Map<Object, Object> newMap(MappingNode node) { try { return (Map<Object, Object>) newInstance(Map.class, node); } catch (InstantiationException e) { return createDefaultMap(node.getValue().size()); } }
final protected Object newInstance(Class<?> ancestor, Node node) throws InstantiationException { return newInstance(ancestor, node, true); }
protected Object newInstance(Node node) { try { return newInstance(Object.class, node); } catch (InstantiationException e) { throw new YAMLException(e); } }
@SuppressWarnings("unchecked") protected Map<Object, Object> newMap(MappingNode node) { try { return (Map<Object, Object>) newInstance(Map.class, node); } catch (InstantiationException e) { return createDefaultMap(); } }
@SuppressWarnings("unchecked") protected Set<Object> newSet(CollectionNode<?> node) { try { return (Set<Object>) newInstance(Set.class, node); } catch (InstantiationException e) { return createDefaultSet(node.getValue().size()); } }
@SuppressWarnings("unchecked") protected List<Object> newList(SequenceNode node) { try { return (List<Object>) newInstance(List.class, node); } catch (InstantiationException e) { return createDefaultList(node.getValue().size()); } }