protected void writeXmlDecl(String decl) throws IOException { super.writeXmlDecl(decl); write('\n'); }
public DOMOutput(Node node, AssociationMap assoc) { super(new SAX2DOMEx(node)); this.assoc = assoc; assert assoc!=null; }
/** * Internal initialization method. * * <p>All of the public constructors invoke this method. * * @param writer The output destination, or null to use * standard output. */ private void init (Writer writer,String encoding) { setOutput(writer,encoding); }
public static String format( String property, Object arg1 ) { return format( property, new Object[]{arg1} ); }
/** * Write an array of data characters with escaping. * * @param ch The array of characters. * @param start The starting position. * @param length The number of characters to use. * @param isAttVal true if this is an attribute value literal. */ private void writeEsc (char ch[], int start, int length, boolean isAttVal) throws IOException { escapeHandler.escape(ch, start, length, isAttVal, output); }
public void endDocument() throws SAXException { try { write('\n'); } catch( IOException e ) { throw new SAXException(e); } super.endDocument(); }
/** * End an element without a Namespace URI or qname. * * <p>This method will supply an empty string for the qName * and an empty string for the Namespace URI. * It invokes {@link #endElement(String, String, String)} * directly.</p> * * @param localName The element's local name. * @exception org.xml.sax.SAXException If there is an error * writing the end tag, or if a handler further down * the filter chain raises an exception. * @see #endElement(String, String, String) */ public void endElement (String localName) throws SAXException { endElement("", localName, ""); }
/** * Start a new element without a qname, attributes or a Namespace URI. * * <p>This method will provide an empty string for the * Namespace URI, and empty string for the qualified name, * and a default empty attribute list. It invokes * #startElement(String, String, String, Attributes)} * directly.</p> * * @param localName The element's local name. * @exception org.xml.sax.SAXException If there is an error * writing the start tag, or if a handler further down * the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement (String localName) throws SAXException { startElement("", localName, "", EMPTY_ATTS); }
/** * Write an element with character data content but no attributes. * * <p>This is a convenience method to write a complete element * with character data content, including the start tag * and end tag. This method provides an empty string * for the qname and an empty attribute list.</p> * * <p>This method invokes * {@link #startElement(String, String, String, Attributes)}, * followed by * {@link #characters(String)}, followed by * {@link #endElement(String, String, String)}.</p> * * @param uri The element's Namespace URI. * @param localName The element's local name. * @param content The character data content. * @exception org.xml.sax.SAXException If there is an error * writing the empty tag, or if a handler further down * the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) * @see #characters(String) * @see #endElement(String, String, String) */ public void dataElement (String uri, String localName, String content) throws SAXException { dataElement(uri, localName, "", EMPTY_ATTS, content); }
protected void writeXmlDecl(String decl) throws IOException { write(decl); }
/** * Create a new XML writer. * * <p>Write to the writer provided.</p> * * @param writer * The output destination, or null to use standard output. * @param encoding * If non-null string is specified, it is written as a part * of the XML declaration. */ public XMLWriter (Writer writer, String encoding, CharacterEscapeHandler _escapeHandler ) { init(writer,encoding); this.escapeHandler = _escapeHandler; }
/** * Write a sequence of characters. * * @param ch The characters to write. * @param start The starting position in the array. * @param length The number of characters to use. * @exception org.xml.sax.SAXException If there is an error * writing the characters, or if a filter further * down the chain raises an exception. * @see XMLWriter#characters(char[], int, int) */ public void characters (char ch[], int start, int length) throws SAXException { state = SEEN_DATA; super.characters(ch, start, length); }
public void characters(char[] ch, int start, int length) { characters(new String(ch, start, length)); }
/** * Reset the writer so that it can be reused. * * <p>This method is especially useful if the writer failed * with an exception the last time through.</p> * * @see XMLWriter#reset() */ public void reset () { depth = 0; state = SEEN_NOTHING; stateStack = new Stack<Object>(); super.reset(); }
public static String format( String property, Object arg1, Object arg2 ) { return format( property, new Object[]{arg1,arg2} ); }
public void text(String value, boolean needsSeparatingWhitespace) throws IOException, SAXException, XMLStreamException { if(needsSeparatingWhitespace) out.writeCharacters(" "); escapeHandler.escape(value.toCharArray(), 0, value.length(), false, writerWrapper); }
/** * End an element without a qname. * * <p>This method will supply an empty string for the qName. * It invokes {@link #endElement(String, String, String)} * directly.</p> * * @param uri The element's Namespace URI. * @param localName The element's local name. * @exception org.xml.sax.SAXException If there is an error * writing the end tag, or if a handler further down * the filter chain raises an exception. * @see #endElement(String, String, String) */ public void endElement (String uri, String localName) throws SAXException { endElement(uri, localName, ""); }
/** * Start a new element without a qname or attributes. * * <p>This method will provide a default empty attribute * list and an empty string for the qualified name. * It invokes {@link * #startElement(String, String, String, Attributes)} * directly.</p> * * @param uri The element's Namespace URI. * @param localName The element's local name. * @exception org.xml.sax.SAXException If there is an error * writing the start tag, or if a handler further down * the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement (String uri, String localName) throws SAXException { startElement(uri, localName, "", EMPTY_ATTS); }
public static String format( String property, Object arg1, Object arg2, Object arg3 ) { return format( property, new Object[]{arg1,arg2,arg3} ); }
public static String format( String property ) { return format( property, null ); }