@Test public void testWriteComment() throws XMLStreamException { XMLStreamWriter writer = createXMLStreamWriter(false); writer.writeStartElement("foo"); writer.writeComment("bar"); writer.writeEndElement(); writer.flush(); Assert.assertEquals("<foo><!--bar--></foo>", writer.toString()); }
@Override public void writeComment(String data) throws XMLStreamException { ensureStartTagClosed(); writeData(data, XMLStreamConstants.COMMENT); }
AbstractXMLStreamWriter implements XMLStreamWriter { @Override public void writeComment(String data) throws XMLStreamException { ensureStartTagClosed(); writeData(data, XMLStreamConstants.COMMENT); } }
AbstractXMLStreamWriter implements XMLStreamWriter { @Override public void writeComment(String data) throws XMLStreamException { ensureStartTagClosed(); writeData(data, XMLStreamConstants.COMMENT); } AbstractXMLStreamWriter(T rootInfo, boolean repairingNamespaces);  AbstractXMLStreamWriter(T rootInfo, Map<String, String> repairingNamespaces); }
AbstractXMLStreamWriter implements XMLStreamWriter { @Override public void writeComment(String data) throws XMLStreamException { ensureStartTagClosed(); writeData(data, XMLStreamConstants.COMMENT); } AbstractXMLStreamWriter(T rootInfo, boolean repairingNamespaces);  AbstractXMLStreamWriter(T rootInfo, Map<String, String> repairingNamespaces); @Override void writeStartElement(String localName); @Override void writeStartElement(String namespaceURI, String localName); @Override void writeStartElement(String prefix, String localName, String namespaceURI); @Override void writeEndElement(); @Override void writeEmptyElement(String localName); @Override void writeEmptyElement(String namespaceURI, String localName); @Override void writeEmptyElement(String prefix, String localName, String namespaceURI); @Override void writeAttribute(String localName, String value); @Override void writeAttribute(String namespaceURI, String localName, String value); @Override void writeAttribute(String prefix, String namespaceURI, String localName, String value); @Override void writeCharacters(String text); @Override void writeCharacters(char[] text, int start, int length); @Override void writeCData(String data); @Override void writeStartDocument(); @Override void writeStartDocument(String version); @Override void writeStartDocument(String encoding, String version); @Override void writeEndDocument(); @Override void close(); @Override void writeNamespace(String prefix, String namespaceURI); @Override void writeDefaultNamespace(String namespaceURI); @Override String getPrefix(String namespaceURI); @Override void setPrefix(String prefix, String namespaceURI); @Override void setDefaultNamespace(String namespaceURI); @Override void setNamespaceContext(NamespaceContext context); @Override NamespaceContext getNamespaceContext(); @Override void writeComment(String data); @Override void writeProcessingInstruction(String target); @Override void writeProcessingInstruction(String target, String data); @Override void writeDTD(String dtd); @Override void writeEntityRef(String name); @Override Object getProperty(String name); }
AbstractXMLStreamWriter implements XMLStreamWriter { @Override public void writeComment(String data) throws XMLStreamException { ensureStartTagClosed(); writeData(data, XMLStreamConstants.COMMENT); } AbstractXMLStreamWriter(T rootInfo, boolean repairingNamespaces);  AbstractXMLStreamWriter(T rootInfo, Map<String, String> repairingNamespaces); @Override void writeStartElement(String localName); @Override void writeStartElement(String namespaceURI, String localName); @Override void writeStartElement(String prefix, String localName, String namespaceURI); @Override void writeEndElement(); @Override void writeEmptyElement(String localName); @Override void writeEmptyElement(String namespaceURI, String localName); @Override void writeEmptyElement(String prefix, String localName, String namespaceURI); @Override void writeAttribute(String localName, String value); @Override void writeAttribute(String namespaceURI, String localName, String value); @Override void writeAttribute(String prefix, String namespaceURI, String localName, String value); @Override void writeCharacters(String text); @Override void writeCharacters(char[] text, int start, int length); @Override void writeCData(String data); @Override void writeStartDocument(); @Override void writeStartDocument(String version); @Override void writeStartDocument(String encoding, String version); @Override void writeEndDocument(); @Override void close(); @Override void writeNamespace(String prefix, String namespaceURI); @Override void writeDefaultNamespace(String namespaceURI); @Override String getPrefix(String namespaceURI); @Override void setPrefix(String prefix, String namespaceURI); @Override void setDefaultNamespace(String namespaceURI); @Override void setNamespaceContext(NamespaceContext context); @Override NamespaceContext getNamespaceContext(); @Override void writeComment(String data); @Override void writeProcessingInstruction(String target); @Override void writeProcessingInstruction(String target, String data); @Override void writeDTD(String dtd); @Override void writeEntityRef(String name); @Override Object getProperty(String name);  }