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