@Override public Danmakus parse() { if (mDataSource != null) { AndroidFileSource source = (AndroidFileSource) mDataSource; try { XMLReader xmlReader = XMLReaderFactory.createXMLReader(); XmlContentHandler contentHandler = new XmlContentHandler(); xmlReader.setContentHandler(contentHandler); xmlReader.parse(new InputSource(source.data())); return contentHandler.getResult(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return null; }
@Override public Danmakus parse() { if (mDataSource != null) { AndroidFileSource source = (AndroidFileSource) mDataSource; try { XMLReader xmlReader = XMLReaderFactory.createXMLReader(); XmlContentHandler contentHandler = new XmlContentHandler(); xmlReader.setContentHandler(contentHandler); xmlReader.parse(new InputSource(source.data())); return contentHandler.getResult(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return null; }
@Override public Danmakus parse() { if (mDataSource != null) { AndroidFileSource source = (AndroidFileSource) mDataSource; try { XMLReader xmlReader = XMLReaderFactory.createXMLReader(); XmlContentHandler contentHandler = new XmlContentHandler(); xmlReader.setContentHandler(contentHandler); xmlReader.parse(new InputSource(source.data())); return contentHandler.getResult(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return null; }
@Override public Danmakus parse() { if (mDataSource != null) { AndroidFileSource source = (AndroidFileSource) mDataSource; try { XMLReader xmlReader = XMLReaderFactory.createXMLReader(); XmlContentHandler contentHandler = new XmlContentHandler(); xmlReader.setContentHandler(contentHandler); xmlReader.parse(new InputSource(source.data())); return contentHandler.getResult(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return null; }
e.printStackTrace(); return false;
/** * Prints this FOP exception and its backtrace to the standard error stream. */ public void printStackTrace() { synchronized (System.err) { super.printStackTrace(); if (getException() != null) { System.err.println(EXCEPTION_SEPARATOR); getException().printStackTrace(); } if (getRootException() != null) { System.err.println(EXCEPTION_SEPARATOR); getRootException().printStackTrace(); } } }
/** * Prints this FOP exception and its backtrace to the specified print stream. * @param stream PrintStream to use for output */ public void printStackTrace(java.io.PrintStream stream) { synchronized (stream) { super.printStackTrace(stream); if (getException() != null) { stream.println(EXCEPTION_SEPARATOR); getException().printStackTrace(stream); } if (getRootException() != null) { stream.println(EXCEPTION_SEPARATOR); getRootException().printStackTrace(stream); } } }
/** * Prints this FOP exception and its backtrace to the specified print writer. * @param writer PrintWriter to use for output */ public void printStackTrace(java.io.PrintWriter writer) { synchronized (writer) { super.printStackTrace(writer); if (getException() != null) { writer.println(EXCEPTION_SEPARATOR); getException().printStackTrace(writer); } if (getRootException() != null) { writer.println(EXCEPTION_SEPARATOR); getRootException().printStackTrace(writer); } } }
System.err.println("ERROR caught exception parsing input file: " + e.getMessage() + "\n"); e.printStackTrace();
e.printStackTrace(); } catch (IOException e) { e.printStackTrace();
e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace();
if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace();
Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace();
@Override protected List<ProvinceModel> doInBackground(Void... params) { if (null == mContext) return null; List<ProvinceModel> provinceList = new ArrayList<ProvinceModel>(); try { SAXParserFactory sax = SAXParserFactory.newInstance();// 创建解析器 XMLReader reader = sax.newSAXParser().getXMLReader(); InputStream in = mContext.getAssets().open("city.xml"); reader.setContentHandler(new ProvinceInfoHandler(provinceList));// 为reader设置内容处理器 reader.parse(new InputSource(in));// 开始解析文件 } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParserConfigurationException e) { e.printStackTrace(); } return provinceList; }
private void doVersionCheck() { try { String warningMsg = "\nYou are using an outdated format for server-setup.xml. Please switch to the new format.\n"; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder dbuilder = dbf.newDocumentBuilder(); File configFile = new File(_configFileName); Document d = dbuilder.parse(configFile); NodeList nodeList = d.getElementsByTagName("version"); if (nodeList.getLength() == 0) { System.out.println(warningMsg); return; } Node firstNode = nodeList.item(0); String version = firstNode.getTextContent(); if (!version.equals("2.0")) { System.out.println(warningMsg); } } catch (ParserConfigurationException parserException) { parserException.printStackTrace(); } catch (IOException ioException) { ioException.printStackTrace(); } catch (SAXException saxException) { saxException.printStackTrace(); } }
public void processTransferManifestNode(TransferManifestDeletedNode node) { try { reportWriter.writeNodeSummary(node); } catch (SAXException error) { error.printStackTrace(); } }
/** * Prints the stack trace to the specified writer. * * @param writer the writer. */ public void printStackTrace(final PrintWriter writer) { super.printStackTrace(writer); if (getException() != null) { writer.println("ParentException: "); getException().printStackTrace(writer); } }