public ToSAXHandler( ContentHandler hdlr, LexicalHandler lex, String encoding) { setContentHandler(hdlr); setLexHandler(lex); setEncoding(encoding); } public ToSAXHandler(ContentHandler handler, String encoding)
/** * Receive notification of character data. * * @param characters The string of characters to process. * * @throws org.xml.sax.SAXException * * @see ExtendedContentHandler#characters(String) */ public void characters(String characters) throws SAXException { final int len = characters.length(); if (len > m_charsBuff.length) { m_charsBuff = new char[len*2 + 1]; } characters.getChars(0,len, m_charsBuff, 0); characters(m_charsBuff, 0, len); }
/** * This method flushes any pending events, which can be startDocument() * closing the opening tag of an element, or closing an open CDATA section. */ public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } }
public ToSAXHandler(ContentHandler handler, String encoding) { setContentHandler(handler); setEncoding(encoding); }
/** * From XSLTC * @see ExtendedContentHandler#startElement(String) */ public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { super.startElement(elementNamespaceURI, elementLocalName, elementName); }
/** * Try's to reset the super class and reset this class for * re-use, so that you don't need to create a new serializer * (mostly for performance reasons). * * @return true if the class was successfuly reset. * @see Serializer#reset() */ public boolean reset() { boolean wasReset = false; if (super.reset()) { resetToXMLSAXHandler(); wasReset = true; } return wasReset; }
/** * Try's to reset the super class and reset this class for * re-use, so that you don't need to create a new serializer * (mostly for performance reasons). * * @return true if the class was successfuly reset. * @see Serializer#reset() */ public boolean reset() { boolean wasReset = false; if (super.reset()) { resetToSAXHandler(); wasReset = true; } return wasReset; }
/** * Receive notification of a comment. * * @see ExtendedLexicalHandler#comment(String) */ public void comment(String comment) throws SAXException { flushPending(); // Ignore if a lexical handler has not been set if (m_lexHandler != null) { final int len = comment.length(); if (len > m_charsBuff.length) { m_charsBuff = new char[len*2 + 1]; } comment.getChars(0,len, m_charsBuff, 0); m_lexHandler.comment(m_charsBuff, 0, len); // time to fire off comment event if (m_tracer != null) super.fireCommentEvent(m_charsBuff, 0, len); } }
public ToSAXHandler( ContentHandler hdlr, LexicalHandler lex, String encoding) { setContentHandler(hdlr); setLexHandler(lex); setEncoding(encoding); } public ToSAXHandler(ContentHandler handler, String encoding)
/** * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes) */ public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { flushPending(); super.startElement(arg0, arg1, arg2, arg3); }
h.setContentHandler(rtfHandler); h.setTransformer(this);
/** * This method flushes any pending events, which can be startDocument() * closing the opening tag of an element, or closing an open CDATA section. */ public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } // Close any open element if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } } /**
/** * Initializer method. * * @param transformer non-null transformer instance * @param realHandler Content Handler instance */ public void init(ToXMLSAXHandler h,Transformer transformer, ContentHandler realHandler) { h.setTransformer(transformer); h.setContentHandler(realHandler); }
public ToSAXHandler(ContentHandler handler, String encoding) { setContentHandler(handler); setEncoding(encoding); }
public void startElement( String elementName) throws SAXException { super.startElement(elementName); }
/** * Try's to reset the super class and reset this class for * re-use, so that you don't need to create a new serializer * (mostly for performance reasons). * * @return true if the class was successfuly reset. * @see Serializer#reset() */ public boolean reset() { boolean wasReset = false; if (super.reset()) { resetToXMLSAXHandler(); wasReset = true; } return wasReset; }
/** * Try's to reset the super class and reset this class for * re-use, so that you don't need to create a new serializer * (mostly for performance reasons). * * @return true if the class was successfuly reset. * @see Serializer#reset() */ public boolean reset() { boolean wasReset = false; if (super.reset()) { resetToSAXHandler(); wasReset = true; } return wasReset; }
/** * Receives notification of the end of the document. * @see org.xml.sax.ContentHandler#endDocument() */ public void endDocument() throws SAXException { flushPending(); // Close output document m_saxHandler.endDocument(); if (m_tracer != null) super.fireEndDoc(); }
public ToSAXHandler( ContentHandler hdlr, LexicalHandler lex, String encoding) { setContentHandler(hdlr); setLexHandler(lex); setEncoding(encoding); } public ToSAXHandler(ContentHandler handler, String encoding)
/** * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes) */ public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { flushPending(); super.startElement(arg0, arg1, arg2, arg3); }