/** * @see SerializationHandler#setTransformer(Transformer) */ public void setTransformer(Transformer transformer) { super.setTransformer(transformer); if (m_tracer != null && !(m_writer instanceof SerializerTraceWriter) ) setWriterInternal(new SerializerTraceWriter(m_writer, m_tracer), false); } /**
public ToXMLSAXHandler(ContentHandler handler, String encoding) { super(handler, encoding); initCDATA(); // initNamespaces(); m_prefixMap = new NamespaceMappings(); }
/** * Default constructor. */ public ToXMLStream() { m_charInfo = m_xmlcharInfo; initCDATA(); // initialize namespaces m_prefixMap = new NamespaceMappings(); }
/** * To fire off end document trace event */ protected void fireEndDoc() throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDDOCUMENT); } }
/** * @see SerializationHandler#flushPending() */ public void flushPending() throws SAXException { flush(); m_handler.flushPending(); }
public void setTransformer(Transformer t) { m_handler.setTransformer(t); if ((t instanceof SerializerTrace) && (((SerializerTrace) t).hasTraceListeners())) { m_tracer = (SerializerTrace) t; } else { m_tracer = null; } } public Transformer getTransformer()
/** * Pass the call on to the underlying handler * @see ExtendedContentHandler#endElement(String) */ public void endElement(String elementName) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.endElement(elementName); }
/** * Pass the call on to the underlying handler * @see org.xml.sax.ContentHandler#endDocument() */ public void endDocument() throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.endDocument(); }
public boolean reset() { boolean ret = super.reset(); if (!ret) return false; resetToHTMLStream(); return true; }
/** * Pass the call on to the underlying handler * @see org.xml.sax.ContentHandler#characters(char[], int, int) */ public void characters(char[] characters, int offset, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.characters(characters, offset, length); }
/** * Pass the call on to the underlying handler * @see org.xml.sax.ext.DeclHandler#elementDecl(String, String) */ public void elementDecl(String arg0, String arg1) throws SAXException { if (m_firstTagNotEmitted) { emitFirstTag(); } m_handler.elementDecl(arg0, arg1); }
/** * Pass the call on to the underlying handler * @see org.xml.sax.ext.LexicalHandler#endEntity(String) */ public void endEntity(String name) throws SAXException { if (m_firstTagNotEmitted) { emitFirstTag(); } m_handler.endEntity(name); }
/** * Adds a unique attribute to the currenly open tag */ public void addUniqueAttribute(String rawName, String value, int flags) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.addUniqueAttribute(rawName, value, flags); }
/** * Pass the call on to the underlying handler * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int) */ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.ignorableWhitespace(ch, start, length); }
/** * To fire off start document trace event */ protected void fireStartDoc() throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_STARTDOCUMENT); } }
public ToXMLSAXHandler( ContentHandler handler, LexicalHandler lex, String encoding) { super(handler, lex, encoding); initCDATA(); // initNamespaces(); m_prefixMap = new NamespaceMappings(); }
/** * To fire off the entity reference trace event * @param name Name of entity reference */ protected void fireEntityReference(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF,name, (Attributes)null); } }
public ToXMLSAXHandler() { // default constructor (need to set content handler ASAP !) m_prefixMap = new NamespaceMappings(); initCDATA(); }
/** * To fire off start entity trace event * @param name Name of entity */ protected void fireStartEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF, name); } }