/** * Set the value of a property * * @param name - The property name, which is a fully-qualified URI. * @param value - The property value * @throws SAXNotRecognizedException - * When the XMLReader does not recognize the property name. * @throws SAXNotSupportedException - * When the XMLReader recognizes the property name but * cannot determine its value at this time. */ public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { // respond to the lexical handler setting if (name.equalsIgnoreCase(LEXICAL_HANDLER_PROPERTY)) { this.xmlOutput.setLexicalHandler((LexicalHandler) value); } }
/** * Sets the SAX ContentHandler to feed SAX events into * * @param contentHandler is the ContentHandler to use. * This value cannot be null. */ public void setContentHandler(ContentHandler contentHandler) { this.xmlOutput.setContentHandler(contentHandler); // often classes will implement LexicalHandler as well if (contentHandler instanceof LexicalHandler) { this.xmlOutput.setLexicalHandler((LexicalHandler) contentHandler); } }
/** * Factory method to create a new XMLOutput from an XMLWriter */ protected static XMLOutput createXMLOutput(final XMLWriter xmlWriter) { XMLOutput answer = new XMLOutput() { public void close() throws IOException { xmlWriter.close(); } }; answer.setContentHandler(xmlWriter); answer.setLexicalHandler(xmlWriter); return answer; }
/** * Factory method to create a new XMLOutput from an XMLWriter */ protected static XMLOutput createXMLOutput(final XMLWriter xmlWriter) { XMLOutput answer = new XMLOutput() { public void close() throws IOException { xmlWriter.close(); } }; answer.setContentHandler(xmlWriter); answer.setLexicalHandler(xmlWriter); return answer; }
/** * Factory method to create a new XMLOutput from an XMLWriter */ protected static XMLOutput createXMLOutput(final XMLWriter xmlWriter) { XMLOutput answer = new XMLOutput() { public void close() throws IOException { xmlWriter.close(); } }; answer.setContentHandler(xmlWriter); answer.setLexicalHandler(xmlWriter); return answer; }
/** * Factory method to create a new XMLOutput from an XMLWriter */ protected static XMLOutput createXMLOutput(final XMLWriter xmlWriter) { XMLOutput answer = new XMLOutput() { public void close() throws IOException { xmlWriter.close(); } }; answer.setContentHandler(xmlWriter); answer.setLexicalHandler(xmlWriter); return answer; }
/** * Creates an XMLOutput from an existing SAX XMLReader */ public static XMLOutput createXMLOutput(XMLReader xmlReader) { XMLOutput output = new XMLOutput(xmlReader.getContentHandler()); // isn't it lovely what we've got to do to find the LexicalHandler... ;-) for (int i = 0; i < LEXICAL_HANDLER_NAMES.length; i++) { try { Object value = xmlReader.getProperty(LEXICAL_HANDLER_NAMES[i]); if (value instanceof LexicalHandler) { output.setLexicalHandler((LexicalHandler) value); break; } } catch (Exception e) { // ignore any unsupported-operation exceptions if (log.isDebugEnabled()) log.debug("error setting lexical handler properties", e); } } return output; }
/** * Creates an XMLOutput from an existing SAX XMLReader. */ public static XMLOutput createXMLOutput(XMLReader xmlReader) { XMLOutput output = new XMLOutput(xmlReader.getContentHandler()); // isn't it lovely what we've got to do to find the LexicalHandler... ;-) for (int i = 0; i < LEXICAL_HANDLER_NAMES.length; i++) { try { Object value = xmlReader.getProperty(LEXICAL_HANDLER_NAMES[i]); if (value instanceof LexicalHandler) { output.setLexicalHandler((LexicalHandler) value); break; } } catch (Exception e) { // ignore any unsupported-operation exceptions if (log.isDebugEnabled()) { log.debug("error setting lexical handler properties", e); } } } return output; }
/** * Creates an XMLOutput from an existing SAX XMLReader. */ public static XMLOutput createXMLOutput(XMLReader xmlReader) { XMLOutput output = new XMLOutput(xmlReader.getContentHandler()); // isn't it lovely what we've got to do to find the LexicalHandler... ;-) for (int i = 0; i < LEXICAL_HANDLER_NAMES.length; i++) { try { Object value = xmlReader.getProperty(LEXICAL_HANDLER_NAMES[i]); if (value instanceof LexicalHandler) { output.setLexicalHandler((LexicalHandler) value); break; } } catch (Exception e) { // ignore any unsupported-operation exceptions if (log.isDebugEnabled()) { log.debug("error setting lexical handler properties", e); } } } return output; }
/** * Creates an XMLOutput from an existing SAX XMLReader. */ public static XMLOutput createXMLOutput(XMLReader xmlReader) { XMLOutput output = new XMLOutput(xmlReader.getContentHandler()); // isn't it lovely what we've got to do to find the LexicalHandler... ;-) for (int i = 0; i < LEXICAL_HANDLER_NAMES.length; i++) { try { Object value = xmlReader.getProperty(LEXICAL_HANDLER_NAMES[i]); if (value instanceof LexicalHandler) { output.setLexicalHandler((LexicalHandler) value); break; } } catch (Exception e) { // ignore any unsupported-operation exceptions if (log.isDebugEnabled()) { log.debug("error setting lexical handler properties", e); } } } return output; }
answer.setLexicalHandler(xmlWriter); return answer;
answer.setLexicalHandler(xmlWriter); return answer;
answer.setLexicalHandler(xmlWriter); return answer;
answer.setLexicalHandler(xmlWriter); return answer;