/** * Adds a simple text element with no attributes or namespace declarations. * * @param name The unqualified element name. * @param text The text content, which may be <code>null</code> * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding an event. */ public void addTextElement(String name, String text, NamespaceContext context) throws XMLStreamException { addStartElement(name, context); if (text != null) { addText(text); } addEndElement(name); }
/** * Adds a text element with no attributes or namespace declarations. * * @param name The unqualified element name. * @param text The element content. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding an event. */ public void addTextElement(String name, int text, NamespaceContext context) throws XMLStreamException { addTextElement(name, Integer.toString(text), context); }
/** * Creates and adds a {@link DTD} event. * * @param dtd The DTD content, as per * {@link XMLEventFactory#createDTD(String)}. * @throws XMLStreamException If an error occurs adding the event. */ public void addDTD(String dtd) throws XMLStreamException { add(factory.createDTD(dtd)); }
/** * Creates and adds a {@link StartElement} event. * * @param name The qualified element name. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding the event. */ public void addStartElement(QName name, NamespaceContext context) throws XMLStreamException { addStartElement(name, null, null, context); }
/** * Creates and adds an {@link EndElement} event. * * @param ns The element namespace. * @param localName The element name. * @throws XMLStreamException If an error occurs adding the event. */ public void addEndElement(String ns, String localName) throws XMLStreamException { addEndElement(ns, localName, (Iterator) null); }
/** * Creates and adds a {@link Comment} event. * * @param comment The comment text, as per * {@link XMLEventFactory#createComment(String)}. * @throws XMLStreamException If an error occurs adding the event. */ public void addComment(String comment) throws XMLStreamException { add(factory.createComment(comment)); }
/** * Creates and adds a {@link StartElement} event. * * @param localName The local name of the element. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding the event. */ public void addStartElement(String localName, NamespaceContext context) throws XMLStreamException { addStartElement(localName, null, null, context); }
/** * Creates and adds an {@link EndElement} event. * * @param name The element name. * @see XMLEventFactory#createEndElement(QName, Iterator) * @throws XMLStreamException If an error occurs adding the event. */ public void addEndElement(QName name) throws XMLStreamException { addEndElement(name, (Iterator) null); }
/** * Adds a simple text element with no attributes or namespace declarations. * * @param name The element name. * @param text The text content, which may be <code>null</code> * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding an event. */ public void addTextElement(QName name, String text, NamespaceContext context) throws XMLStreamException { addStartElement(name, context); if (text != null) { addText(text); } addEndElement(name); }
/** * Creates and adds a CDATA {@link Characters} event. * * @param content The CDATA content, as per * {@link XMLEventFactory#createCData(String)}. * @throws XMLStreamException If an error occurs adding the event. */ public void addCData(String content) throws XMLStreamException { add(factory.createCData(content)); }
/** * Adds a text element with no attributes or namespace declarations. * * @param name The unqualified element name. * @param text The element content. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding an event. */ public void addTextElement(String name, double text, NamespaceContext context) throws XMLStreamException { addTextElement(name, Double.toString(text), context); }
/** * Creates and adds a {@link StartElement} event. * * @param ns The element's namespace URI. * @param localName The local name of the element. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding the event. */ public void addStartElement(String ns, String localName, NamespaceContext context) throws XMLStreamException { addStartElement(ns, localName, null, null, context); }
/** * Creates and adds an {@link EndElement} event. * * @param localName The unqualified element name. * @throws XMLStreamException If an error occurs adding the event. */ public void addEndElement(String localName) throws XMLStreamException { addEndElement(localName, (Iterator) null); }
/** * Creates and adds a {@link StartDocument} event. * * @param encoding The encoding to include in the xml declaration. * @param version The XML version to include in the xml declaration. * @see XMLEventFactory#createStartDocument(String, String) * @throws XMLStreamException If an error occurs adding the event. */ public void addStartDocument(String encoding, String version) throws XMLStreamException { add(factory.createStartDocument(encoding, version)); }
/** * Adds a text element with no attributes or namespace declarations. * * @param name The element name. * @param text The element content. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding an event. */ public void addTextElement(QName name, double text, NamespaceContext context) throws XMLStreamException { addTextElement(name, Double.toString(text), context); }
/** * Creates and adds an {@link EndDocument} event. * * @see XMLEventFactory#createEndDocument() * @throws XMLStreamException If an error occurs adding the event. */ public void addEndDocument() throws XMLStreamException { add(factory.createEndDocument()); }
/** * Adds a boolean text element with no attributes or namespace declarations. * * @param name The element name. * @param text The boolean content. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding an event. */ public void addTextElement(QName name, boolean text, NamespaceContext context) throws XMLStreamException { addTextElement(name, Boolean.toString(text), context); }
/** * Creates and adds a {@link Characters} event. * * @param content The text content, as per * {@link XMLEventFactory#createCharacters(String)}. * @throws XMLStreamException If an error occurs adding the event. */ public void addText(String content) throws XMLStreamException { add(factory.createCharacters(content)); }
/** * Adds a text element with no attributes or namespace declarations. * * @param name The element name. * @param text The element content. * @param context The element's {@link NamespaceContext}, or <code>null</code>. * @throws XMLStreamException If an error occurs adding an event. */ public void addTextElement(QName name, long text, NamespaceContext context) throws XMLStreamException { addTextElement(name, Long.toString(text), context); }
/** * Creates and adds a whitespace {@link Characters} event. * * @param content The whitespace, as per * {@link XMLEventFactory#createIgnorableSpace(String)}. * @throws XMLStreamException If an error occurs adding the event. */ public void addSpace(String content) throws XMLStreamException { add(factory.createSpace(content)); }