1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.yaml.snakeyaml.nodes;
18
19 import java.util.List;
20
21 import org.yaml.snakeyaml.error.Mark;
22
23
24
25
26
27
28
29 public class SequenceNode extends CollectionNode {
30 final private List<Node> value;
31
32 public SequenceNode(Tag tag, boolean resolved, List<Node> value, Mark startMark, Mark endMark,
33 Boolean flowStyle) {
34 super(tag, startMark, endMark, flowStyle);
35 if (value == null) {
36 throw new NullPointerException("value in a Node is required.");
37 }
38 this.value = value;
39 this.resolved = resolved;
40 }
41
42 public SequenceNode(Tag tag, List<Node> value, Boolean flowStyle) {
43 this(tag, true, value, null, null, flowStyle);
44 }
45
46 @Override
47 public NodeId getNodeId() {
48 return NodeId.sequence;
49 }
50
51
52
53
54
55
56 public List<Node> getValue() {
57 return value;
58 }
59
60 public void setListType(Class<? extends Object> listType) {
61 for (Node node : value) {
62 node.setType(listType);
63 }
64 }
65
66 public String toString() {
67 return "<" + this.getClass().getName() + " (tag=" + getTag() + ", value=" + getValue()
68 + ")>";
69 }
70 }