public void writeStartDocument(String encoding, String version) throws XMLStreamException { writeStartDocument(); }
public void writeEmptyElement(String prefix, String namespace, String local) throws XMLStreamException { writeStartElement(prefix, namespace, local); }
public void writeStartElement(String prefix, String local, String namespace) throws XMLStreamException { if (prefix == null || prefix.equals("")) { writeStartElement(namespace, local); } else { newChild(document.createElementNS(namespace, prefix + ":" + local)); } }
public void writeStartElement(String local) throws XMLStreamException { newChild(document.createElement(local)); }
public void writeCharacters(char[] text, int start, int len) throws XMLStreamException { writeCharacters(new String(text, start, len)); }
public void writeNamespace(String prefix, String namespace) throws XMLStreamException { if (prefix.length() == 0) { writeDefaultNamespace(namespace); } else { currentNode.setAttributeNS(XML_NS, "xmlns:" + prefix, namespace); } }
public void marshal(Object jaxbElement, Result result) throws JAXBException { if (jaxbElement == null) throw new IllegalArgumentException("jaxbElement is null"); if (result == null) throw new IllegalArgumentException("result is null"); XMLStreamWriter writer = null; try { if (result instanceof DOMResult) { Node node = ((DOMResult) result).getNode(); if (node instanceof Document) { writer = new W3CDOMStreamWriter((Document) node); } else if (node instanceof Element) { writer = new W3CDOMStreamWriter((Element) node); } else { throw new UnsupportedOperationException("Node type not supported."); } } else { writer = XmlFactories.getXof().createXMLStreamWriter(result); } marshal(jaxbElement, writer); } catch (XMLStreamException e) { throw new JAXBException("Could not close XMLStreamWriter.", e); } finally { if (writer != null) { try { writer.close(); } catch (XMLStreamException ignored) { } } } }
public void writeStartElement(String namespace, String local) throws XMLStreamException { newChild(document.createElementNS(namespace, local)); }
public void writeEmptyElement(String namespace, String local) throws XMLStreamException { writeStartElement(namespace, local); }
public void writeStartDocument(String version) throws XMLStreamException { writeStartDocument(); }
public void writeEmptyElement(String local) throws XMLStreamException { writeStartElement(local); }