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