create domdocument.xml with xml writer 3

This commit is contained in:
2016-03-10 13:10:40 +01:00
parent 07ee304706
commit 36a9ca659d
2 changed files with 389 additions and 343 deletions
File diff suppressed because it is too large Load Diff
@@ -54,7 +54,36 @@ public class XFLXmlWriter implements XMLStreamWriter {
return this;
}
private XFLXmlWriter append(String text) {
// todo: remove
public XFLXmlWriter append(StringBuilder stringBuilder) {
sb.append(stringBuilder);
newLine = false;
return this;
}
// todo: remove
public XFLXmlWriter append(int value) {
sb.append(value);
newLine = false;
return this;
}
// todo: remove
public XFLXmlWriter append(float value) {
sb.append(value);
newLine = false;
return this;
}
// todo: remove
public XFLXmlWriter append(double value) {
sb.append(value);
newLine = false;
return this;
}
// todo: make this private
public XFLXmlWriter append(String text) {
sb.append(text);
newLine = false;
return this;
@@ -216,6 +245,14 @@ public class XFLXmlWriter implements XMLStreamWriter {
append(' ').append(localName).append("=\"").append(escapeAttribute(value)).append('"');
}
public void writeAttribute(String localName, double value) throws XMLStreamException {
writeAttribute(localName, Double.toString(value));
}
public void writeAttribute(String localName, int value) throws XMLStreamException {
writeAttribute(localName, Integer.toString(value));
}
@Override
public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
setPrefix(prefix, namespaceURI);
@@ -350,4 +387,9 @@ public class XFLXmlWriter implements XMLStreamWriter {
public int length() {
return sb.length();
}
// todo: remove
void setLength(int newLength) {
sb.setLength(newLength);
}
}