protected void constructSequenceStep2(SequenceNode node, Collection<Object> collection) { for (Node child : node.getValue()) { collection.add(constructObject(child)); } }
public String toString() { return "<" + this.getClass().getName() + " (tag=" + getTag() + ", value=" + getValue() + ")>"; } }
@SuppressWarnings("unchecked") protected List<Object> newList(SequenceNode node) { try { return (List<Object>) newInstance(List.class, node); } catch (InstantiationException e) { return createDefaultList(node.getValue().size()); } }
private boolean isEmptySequenceNode(final Node valueNode) { return Tag.SEQ.equals(valueNode.getTag()) && ((SequenceNode) valueNode).getValue().isEmpty(); }
protected Object constructArray(SequenceNode node) { return constructArrayStep2(node, createArray(node.getType(), node.getValue().size())); }
for (Node child : node.getValue()) {
return createArray(node.getType(), snode.getValue().size()); } else { return constructArray(snode); snode.getValue().size()); for (java.lang.reflect.Constructor<?> constructor : node.getType() .getDeclaredConstructors()) { if (snode.getValue().size() == constructor.getParameterTypes().length) { possibleConstructors.add(constructor); Object[] argumentList = new Object[snode.getValue().size()]; java.lang.reflect.Constructor<?> c = possibleConstructors.get(0); int index = 0; for (Node argumentNode : snode.getValue()) { Class<?> type = c.getParameterTypes()[index]; "No suitable constructor with " + String.valueOf(snode.getValue().size()) + " arguments found for " + node.getType());
for (Node childNode : snode.getValue()) { Object member = iter.next(); if (member != null) {
case sequence: SequenceNode seqNode = (SequenceNode) node; List<Node> list = seqNode.getValue(); for (Node item : list) { anchorNode(item);
case sequence: SequenceNode sn = (SequenceNode) valueNode; List<Node> vals = sn.getValue(); for (Node subnode : vals) { if (!(subnode instanceof MappingNode)) {
for (Node subnode : snode.getValue()) { if (!(subnode instanceof MappingNode)) { throw new ConstructorException("while constructing an ordered map",
this.emitter.emit(new SequenceStartEvent(tAlias, node.getTag().getValue(), implicitS, null, null, seqNode.getFlowStyle())); List<Node> list = seqNode.getValue(); for (Node item : list) { serializeNode(item, node);
protected void constructSequenceStep2(SequenceNode node, Collection<Object> collection) { for (Node child : node.getValue()) { collection.add(constructObject(child)); } }
@Override public void put(Node value) { getParent().getValue().set(index, value); } @Override
protected List<Node> asSequence(final Node node) throws ParserException { if (node == null) { return Collections.emptyList(); } if (node.getNodeId() != NodeId.sequence) { throw new ParserException("Node must be a sequence", node); } final SequenceNode sequenceNode = (SequenceNode) node; return sequenceNode.getValue(); }
private boolean isEmptySequence(NodeTuple tuple) { return tuple.getValueNode() instanceof SequenceNode && ((SequenceNode) tuple.getValueNode()) .getValue().isEmpty(); }
public YSeqType notEmpty() { require((DynamicSchemaContext dc, Node parent, Node node, YType type, IProblemCollector problems) -> { SequenceNode seq = (SequenceNode) node; if (seq.getValue().size()==0) { problems.accept(YamlSchemaProblems.schemaProblem("At least one '"+el+"' is required", node)); } }); return this; } }
private SequenceNode cloneSequenceNode(SequenceNode node, Map<String, String> parameters) { List<Node> nodes = new ArrayList<Node>(); for (Node item : node.getValue()) { nodes.add(cloneNode(item, parameters)); } return new SequenceNode(node.getTag(), nodes, node.getFlowStyle()); }
private SequenceNode cloneSequenceNode(SequenceNode node, Map<String, String> parameters) { List<Node> nodes = new ArrayList<Node>(); for (Node item : node.getValue()) { nodes.add(cloneNode(item, parameters)); } return new SequenceNode(node.getTag(), nodes, node.getFlowStyle()); }