Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made line separators for graphml out os independent.

  • Loading branch information...
commit 8762d9d9d042cdfc53cf4a393f0c94fe78bebbb6 1 parent 1a14f3b
stephen mallette spmallette authored
13 blueprints-core/src/main/java/com/tinkerpop/blueprints/util/io/graphml/GraphMLWriterHelper.java
View
@@ -162,6 +162,7 @@ public Object getProperty(String name) throws IllegalArgumentException {
private Stack<Object> stateStack = new Stack<Object>();
private String indentStep = " ";
+ private static final String lineSeparator = System.getProperty("line.separator", "\n");
private int depth = 0;
public IndentingXMLStreamWriter(XMLStreamWriter writer) {
@@ -207,7 +208,7 @@ private void onStartElement() throws XMLStreamException {
stateStack.push(SEEN_ELEMENT);
state = SEEN_NOTHING;
if (depth > 0) {
- super.writeCharacters("\n");
+ super.writeCharacters(lineSeparator);
}
doIndent();
depth++;
@@ -216,7 +217,7 @@ private void onStartElement() throws XMLStreamException {
private void onEndElement() throws XMLStreamException {
depth--;
if (state == SEEN_ELEMENT) {
- super.writeCharacters("\n");
+ super.writeCharacters(lineSeparator);
doIndent();
}
state = stateStack.pop();
@@ -225,7 +226,7 @@ private void onEndElement() throws XMLStreamException {
private void onEmptyElement() throws XMLStreamException {
state = SEEN_ELEMENT;
if (depth > 0) {
- super.writeCharacters("\n");
+ super.writeCharacters(lineSeparator);
}
doIndent();
}
@@ -247,17 +248,17 @@ private void doIndent() throws XMLStreamException {
public void writeStartDocument() throws XMLStreamException {
super.writeStartDocument();
- super.writeCharacters("\n");
+ super.writeCharacters(lineSeparator);
}
public void writeStartDocument(String version) throws XMLStreamException {
super.writeStartDocument(version);
- super.writeCharacters("\n");
+ super.writeCharacters(lineSeparator);
}
public void writeStartDocument(String encoding, String version) throws XMLStreamException {
super.writeStartDocument(encoding, version);
- super.writeCharacters("\n");
+ super.writeCharacters(lineSeparator);
}
public void writeStartElement(String localName) throws XMLStreamException {
Please sign in to comment.
Something went wrong with that request. Please try again.