protected Object constructArray(SequenceNode node) { return constructArrayStep2(node, createArray(node.getType(), node.getValue().size())); }
protected Object constructArrayStep2(SequenceNode node, Object array) { final Class<?> componentType = node.getType().getComponentType();
@SuppressWarnings("unchecked") protected List<? extends Object> constructSequence(SequenceNode node) { List<Object> result; if (List.class.isAssignableFrom(node.getType()) && !node.getType().isInterface()) { // the root class may be defined (Vector for instance) try { result = (List<Object>) node.getType().newInstance(); } catch (Exception e) { throw new YAMLException(e); } } else { result = createDefaultList(node.getValue().size()); } constructSequenceStep2(node, result); return result; }
@SuppressWarnings("unchecked") protected List<? extends Object> constructSequence(SequenceNode node) { List<Object> result; if (List.class.isAssignableFrom(node.getType()) && !node.getType().isInterface()) { // the root class may be defined (Vector for instance) try { result = (List<Object>) node.getType().newInstance(); } catch (Exception e) { throw new YAMLException(e); } } else { result = createDefaultList(node.getValue().size()); } constructSequenceStep2(node, result); return result; }
@SuppressWarnings("unchecked") protected Set<? extends Object> constructSet(SequenceNode node) { Set<Object> result; if (!node.getType().isInterface()) { // the root class may be defined try { result = (Set<Object>) node.getType().newInstance(); } catch (Exception e) { throw new YAMLException(e); } } else { result = createDefaultSet(node.getValue().size()); } constructSequenceStep2(node, result); return result; }
@SuppressWarnings("unchecked") protected Set<? extends Object> constructSet(SequenceNode node) { Set<Object> result; if (!node.getType().isInterface()) { // the root class may be defined try { result = (Set<Object>) node.getType().newInstance(); } catch (Exception e) { throw new YAMLException(e); } } else { result = createDefaultSet(node.getValue().size()); } constructSequenceStep2(node, result); return result; }
protected Object constructArray(SequenceNode node) { return constructArrayStep2(node, createArray(node.getType(), node.getValue().size())); }
protected Object constructArray(SequenceNode node) { return constructArrayStep2(node, createArray(node.getType(), node.getValue().size())); }
protected Object constructArray(SequenceNode node) { return constructArrayStep2(node, createArray(node.getType(), node.getValue().size())); }
protected Object constructArrayStep2(SequenceNode node, Object array) { final Class<?> componentType = node.getType().getComponentType();
protected Object constructArrayStep2(SequenceNode node, Object array) { final Class<?> componentType = node.getType().getComponentType();
protected Object constructArrayStep2(SequenceNode node, Object array) { final Class<?> componentType = node.getType().getComponentType();