From 6379e8cc273b55de459f9eeb71e13c36a75b86f6 Mon Sep 17 00:00:00 2001
From: kimchy
Date: Fri, 9 Apr 2010 00:06:05 +0300
Subject: [PATCH] rename yaml Node to YamlNode
---
.../util/yaml/snakeyaml/Loader.java | 18 +++----
.../util/yaml/snakeyaml/Yaml.java | 6 +--
.../yaml/snakeyaml/composer/Composer.java | 40 +++++++-------
.../constructor/AbstractConstruct.java | 6 +--
.../constructor/BaseConstructor.java | 26 +++++-----
.../yaml/snakeyaml/constructor/Construct.java | 6 +--
.../snakeyaml/constructor/Constructor.java | 22 ++++----
.../constructor/SafeConstructor.java | 52 +++++++++----------
.../yaml/snakeyaml/nodes/CollectionNode.java | 2 +-
.../util/yaml/snakeyaml/nodes/NodeTuple.java | 10 ++--
.../util/yaml/snakeyaml/nodes/ScalarNode.java | 2 +-
.../yaml/snakeyaml/nodes/SequenceNode.java | 10 ++--
.../nodes/{Node.java => YamlNode.java} | 4 +-
13 files changed, 102 insertions(+), 102 deletions(-)
rename modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/{Node.java => YamlNode.java} (98%)
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Loader.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Loader.java
index cda747fe6e2..642e4b5c880 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Loader.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Loader.java
@@ -23,7 +23,7 @@ import org.elasticsearch.util.yaml.snakeyaml.constructor.BaseConstructor;
import org.elasticsearch.util.yaml.snakeyaml.constructor.Constructor;
import org.elasticsearch.util.yaml.snakeyaml.error.YAMLException;
import org.elasticsearch.util.yaml.snakeyaml.events.Event;
-import org.elasticsearch.util.yaml.snakeyaml.nodes.Node;
+import org.elasticsearch.util.yaml.snakeyaml.nodes.YamlNode;
import org.elasticsearch.util.yaml.snakeyaml.parser.Parser;
import org.elasticsearch.util.yaml.snakeyaml.parser.ParserImpl;
import org.elasticsearch.util.yaml.snakeyaml.reader.StreamReader;
@@ -81,7 +81,7 @@ public class Loader {
* @param yaml YAML document
* @return parsed root Node for the specified YAML document
*/
- public Node compose(Reader yaml) {
+ public YamlNode compose(Reader yaml) {
Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver);
this.constructor.setComposer(composer);
return composer.getSingleNode();
@@ -94,15 +94,15 @@ public class Loader {
* @param yaml stream of YAML documents
* @return parsed root Nodes for all the specified YAML documents
*/
- public Iterable composeAll(Reader yaml) {
+ public Iterable composeAll(Reader yaml) {
final Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver);
this.constructor.setComposer(composer);
- Iterator result = new Iterator() {
+ Iterator result = new Iterator() {
public boolean hasNext() {
return composer.checkNode();
}
- public Node next() {
+ public YamlNode next() {
return composer.getNode();
}
@@ -113,14 +113,14 @@ public class Loader {
return new NodeIterable(result);
}
- private class NodeIterable implements Iterable {
- private Iterator iterator;
+ private class NodeIterable implements Iterable {
+ private Iterator iterator;
- public NodeIterable(Iterator iterator) {
+ public NodeIterable(Iterator iterator) {
this.iterator = iterator;
}
- public Iterator iterator() {
+ public Iterator iterator() {
return iterator;
}
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Yaml.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Yaml.java
index 48c3f01ed45..2bdaea598ff 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Yaml.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/Yaml.java
@@ -19,7 +19,7 @@
package org.elasticsearch.util.yaml.snakeyaml;
import org.elasticsearch.util.yaml.snakeyaml.events.Event;
-import org.elasticsearch.util.yaml.snakeyaml.nodes.Node;
+import org.elasticsearch.util.yaml.snakeyaml.nodes.YamlNode;
import org.elasticsearch.util.yaml.snakeyaml.reader.UnicodeReader;
import org.elasticsearch.util.yaml.snakeyaml.resolver.Resolver;
@@ -130,7 +130,7 @@ public class Yaml {
* @param io stream of a YAML document
* @return parsed root Node for the specified YAML document
*/
- public Node compose(Reader io) {
+ public YamlNode compose(Reader io) {
return loader.compose(io);
}
@@ -141,7 +141,7 @@ public class Yaml {
* @param io stream of YAML documents
* @return parsed root Nodes for all the specified YAML documents
*/
- public Iterable composeAll(Reader io) {
+ public Iterable composeAll(Reader io) {
return loader.composeAll(io);
}
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/composer/Composer.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/composer/Composer.java
index a0bffe5b505..b77e71047b6 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/composer/Composer.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/composer/Composer.java
@@ -35,14 +35,14 @@ import java.util.*;
public class Composer {
private final Parser parser;
private final Resolver resolver;
- private final Map anchors;
- private final Set recursiveNodes;
+ private final Map anchors;
+ private final Set recursiveNodes;
public Composer(Parser parser, Resolver resolver) {
this.parser = parser;
this.resolver = resolver;
- this.anchors = new HashMap();
- this.recursiveNodes = new HashSet();
+ this.anchors = new HashMap();
+ this.recursiveNodes = new HashSet();
}
/**
@@ -65,12 +65,12 @@ public class Composer {
* @return The root node of the document or null
if no more
* documents are available.
*/
- public Node getNode() {
+ public YamlNode getNode() {
// Get the root node of the next document.
if (!parser.checkEvent(Event.ID.StreamEnd)) {
return composeDocument();
} else {
- return (Node) null;
+ return (YamlNode) null;
}
}
@@ -83,11 +83,11 @@ public class Composer {
* @return The root node of the document or null
if no document
* is available.
*/
- public Node getSingleNode() {
+ public YamlNode getSingleNode() {
// Drop the STREAM-START event.
parser.getEvent();
// Compose a document if the stream is not empty.
- Node document = null;
+ YamlNode document = null;
if (!parser.checkEvent(Event.ID.StreamEnd)) {
document = composeDocument();
}
@@ -102,11 +102,11 @@ public class Composer {
return document;
}
- private Node composeDocument() {
+ private YamlNode composeDocument() {
// Drop the DOCUMENT-START event.
parser.getEvent();
// Compose the root node.
- Node node = composeNode(null, null);
+ YamlNode node = composeNode(null, null);
// Drop the DOCUMENT-END event.
parser.getEvent();
this.anchors.clear();
@@ -114,7 +114,7 @@ public class Composer {
return node;
}
- private Node composeNode(Node parent, Object index) {
+ private YamlNode composeNode(YamlNode parent, Object index) {
recursiveNodes.add(parent);
if (parser.checkEvent(Event.ID.Alias)) {
AliasEvent event = (AliasEvent) parser.getEvent();
@@ -123,7 +123,7 @@ public class Composer {
throw new ComposerException(null, null, "found undefined alias " + anchor, event
.getStartMark());
}
- Node result = (Node) anchors.get(anchor);
+ YamlNode result = (YamlNode) anchors.get(anchor);
if (recursiveNodes.remove(result)) {
result.setTwoStepsConstruction(true);
}
@@ -138,7 +138,7 @@ public class Composer {
.getStartMark());
}
// resolver.descendResolver(parent, index);
- Node node = null;
+ YamlNode node = null;
if (parser.checkEvent(Event.ID.Scalar)) {
node = composeScalarNode(anchor);
} else if (parser.checkEvent(Event.ID.SequenceStart)) {
@@ -151,7 +151,7 @@ public class Composer {
return node;
}
- private Node composeScalarNode(String anchor) {
+ private YamlNode composeScalarNode(String anchor) {
ScalarEvent ev = (ScalarEvent) parser.getEvent();
String tag = ev.getTag();
boolean resolved = false;
@@ -162,7 +162,7 @@ public class Composer {
} else {
nodeTag = new Tag(tag);
}
- Node node = new ScalarNode(nodeTag, resolved, ev.getValue(), ev.getStartMark(), ev
+ YamlNode node = new ScalarNode(nodeTag, resolved, ev.getValue(), ev.getStartMark(), ev
.getEndMark(), ev.getStyle());
if (anchor != null) {
anchors.put(anchor, node);
@@ -170,7 +170,7 @@ public class Composer {
return node;
}
- private Node composeSequenceNode(String anchor) {
+ private YamlNode composeSequenceNode(String anchor) {
SequenceStartEvent startEvent = (SequenceStartEvent) parser.getEvent();
String tag = startEvent.getTag();
Tag nodeTag;
@@ -181,7 +181,7 @@ public class Composer {
} else {
nodeTag = new Tag(tag);
}
- SequenceNode node = new SequenceNode(nodeTag, resolved, new ArrayList(), startEvent
+ SequenceNode node = new SequenceNode(nodeTag, resolved, new ArrayList(), startEvent
.getStartMark(), null, startEvent.getFlowStyle());
if (anchor != null) {
anchors.put(anchor, node);
@@ -196,7 +196,7 @@ public class Composer {
return node;
}
- private Node composeMappingNode(String anchor) {
+ private YamlNode composeMappingNode(String anchor) {
MappingStartEvent startEvent = (MappingStartEvent) parser.getEvent();
String tag = startEvent.getTag();
Tag nodeTag;
@@ -213,8 +213,8 @@ public class Composer {
anchors.put(anchor, node);
}
while (!parser.checkEvent(Event.ID.MappingEnd)) {
- Node itemKey = composeNode(node, null);
- Node itemValue = composeNode(node, itemKey);
+ YamlNode itemKey = composeNode(node, null);
+ YamlNode itemValue = composeNode(node, itemKey);
node.getValue().add(new NodeTuple(itemKey, itemValue));
}
Event endEvent = parser.getEvent();
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/AbstractConstruct.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/AbstractConstruct.java
index 77cdaa78d51..f5e12e42e5d 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/AbstractConstruct.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/AbstractConstruct.java
@@ -19,7 +19,7 @@
package org.elasticsearch.util.yaml.snakeyaml.constructor;
import org.elasticsearch.util.yaml.snakeyaml.error.YAMLException;
-import org.elasticsearch.util.yaml.snakeyaml.nodes.Node;
+import org.elasticsearch.util.yaml.snakeyaml.nodes.YamlNode;
/**
* Because recursive structures are not very common we provide a way to save
@@ -31,10 +31,10 @@ public abstract class AbstractConstruct implements Construct {
* Fail with a reminder to provide the seconds step for a recursive
* structure
*
- * @see org.elasticsearch.util.yaml.snakeyaml.constructor.Construct#construct2ndStep(org.elasticsearch.util.yaml.snakeyaml.nodes.Node,
+ * @see org.elasticsearch.util.yaml.snakeyaml.constructor.Construct#construct2ndStep(org.elasticsearch.util.yaml.snakeyaml.nodes.YamlNode ,
* java.lang.Object)
*/
- public void construct2ndStep(Node node, Object data) {
+ public void construct2ndStep(YamlNode node, Object data) {
if (node.isTwoStepsConstruction()) {
throw new IllegalStateException("Not Implemented in " + getClass().getName());
} else {
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/BaseConstructor.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/BaseConstructor.java
index 572c55a372e..c88d12cf33e 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/BaseConstructor.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/constructor/BaseConstructor.java
@@ -50,16 +50,16 @@ public abstract class BaseConstructor {
protected final Map yamlMultiConstructors = new HashMap();
private Composer composer;
- private final Map constructedObjects;
- private final Set recursiveObjects;
+ private final Map constructedObjects;
+ private final Set recursiveObjects;
private final ArrayList, RecursiveTuple
*/
-public class ScalarNode extends Node {
+public class ScalarNode extends YamlNode {
private Character style;
private String value;
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/SequenceNode.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/SequenceNode.java
index 2de27aea1d7..a42ec91eefa 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/SequenceNode.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/SequenceNode.java
@@ -30,9 +30,9 @@ import java.util.List;
*/
public class SequenceNode extends CollectionNode {
private Class extends Object> listType;
- private List value;
+ private List value;
- public SequenceNode(Tag tag, boolean resolved, List value, Mark startMark, Mark endMark,
+ public SequenceNode(Tag tag, boolean resolved, List value, Mark startMark, Mark endMark,
Boolean flowStyle) {
super(tag, startMark, endMark, flowStyle);
if (value == null) {
@@ -43,7 +43,7 @@ public class SequenceNode extends CollectionNode {
this.resolved = resolved;
}
- public SequenceNode(Tag tag, List value, Boolean flowStyle) {
+ public SequenceNode(Tag tag, List value, Boolean flowStyle) {
this(tag, true, value, null, null, flowStyle);
}
@@ -57,8 +57,8 @@ public class SequenceNode extends CollectionNode {
*
* @return Nodes in the specified order.
*/
- public List getValue() {
- for (Node node : value) {
+ public List getValue() {
+ for (YamlNode node : value) {
node.setType(listType);
}
return value;
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/Node.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/YamlNode.java
similarity index 98%
rename from modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/Node.java
rename to modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/YamlNode.java
index 35b335e42f1..ce532f10bcd 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/Node.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/yaml/snakeyaml/nodes/YamlNode.java
@@ -33,7 +33,7 @@ import org.elasticsearch.util.yaml.snakeyaml.error.Mark;
* {@link org.elasticsearch.util.yaml.snakeyaml.constructor} package.
*
*/
-public abstract class Node {
+public abstract class YamlNode {
private Tag tag;
private Mark startMark;
protected Mark endMark;
@@ -45,7 +45,7 @@ public abstract class Node {
protected boolean resolved;
protected Boolean useClassConstructor;
- public Node(Tag tag, Mark startMark, Mark endMark) {
+ public YamlNode(Tag tag, Mark startMark, Mark endMark) {
setTag(tag);
this.startMark = startMark;
this.endMark = endMark;