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 | 27126 | super(tag, startMark, endMark, flowStyle); |
35 | 27126 | if (value == null) { |
36 | 1 | throw new NullPointerException("value in a Node is required."); |
37 | |
} |
38 | 27125 | this.value = value; |
39 | 27125 | this.resolved = resolved; |
40 | 27125 | } |
41 | |
|
42 | |
public SequenceNode(Tag tag, List<Node> value, Boolean flowStyle) { |
43 | 16224 | this(tag, true, value, null, null, flowStyle); |
44 | 16224 | } |
45 | |
|
46 | |
@Override |
47 | |
public NodeId getNodeId() { |
48 | 97484 | return NodeId.sequence; |
49 | |
} |
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
public List<Node> getValue() { |
57 | 70310 | return value; |
58 | |
} |
59 | |
|
60 | |
public void setListType(Class<? extends Object> listType) { |
61 | 102 | for (Node node : value) { |
62 | 182 | node.setType(listType); |
63 | |
} |
64 | 102 | } |
65 | |
|
66 | |
public String toString() { |
67 | 3 | return "<" + this.getClass().getName() + " (tag=" + getTag() + ", value=" + getValue() |
68 | |
+ ")>"; |
69 | |
} |
70 | |
} |