Skip to content

Commit

Permalink
Fix formatting, additional features
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lloyd committed Jun 25, 2010
1 parent ef605b6 commit 1fefa00
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@ public void writeEmptyElement(final String namespaceURI, final String localName)
nl();
indent();
delegate.writeEmptyElement(namespaceURI, localName);
delegate.writeCharacters("\n");
state = END_ELEMENT;
}

public void writeEmptyElement(final String prefix, final String localName, final String namespaceURI) throws XMLStreamException {
nl();
indent();
delegate.writeEmptyElement(prefix, namespaceURI, localName);
delegate.writeCharacters("\n");
state = END_ELEMENT;
}

public void writeEmptyElement(final String localName) throws XMLStreamException {
nl();
indent();
delegate.writeEmptyElement(localName);
delegate.writeCharacters("\n");
state = END_ELEMENT;
}

public void writeEndElement() throws XMLStreamException {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jboss/staxmapper/XMLContentWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
public interface XMLContentWriter {
void writeObject(XMLStreamWriter streamWriter) throws XMLStreamException;
void writeContent(XMLStreamWriter streamWriter) throws XMLStreamException;
}
2 changes: 1 addition & 1 deletion src/main/java/org/jboss/staxmapper/XMLMapperImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void parseDocument(Object rootObject, XMLStreamReader reader) throws XMLS
*/
public void deparseDocument(XMLContentWriter contentWriter, XMLStreamWriter streamWriter) throws XMLStreamException {
// todo: add validation based on the registered root elements?
contentWriter.writeObject(new FormattingXMLStreamWriter(streamWriter));
contentWriter.writeContent(new FormattingXMLStreamWriter(streamWriter));
}

@SuppressWarnings({ "unchecked" })
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/jboss/staxmapper/SimpleWriteTest1.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) throws XMLStreamException {
System.out.println("Output: " + writer.getBuffer().toString());
}

public void writeObject(final XMLStreamWriter streamWriter) throws XMLStreamException {
public void writeContent(final XMLStreamWriter streamWriter) throws XMLStreamException {
streamWriter.writeStartDocument("UTF-8", "1.0");
streamWriter.writeStartElement("hello");
streamWriter.writeStartElement("hello-two");
Expand Down

0 comments on commit 1fefa00

Please sign in to comment.