public Object readObject() {
if (in == null) {
return null;
}
if (handler == null) {
SAXParserFactory factory = SAXParserFactory.newInstance();
try {
SAXParser saxParser = factory.newSAXParser();
handler = new ObjectHandler(this, getClassLoader());
saxParser.parse(in, handler);
}
catch (ParserConfigurationException e) {
getExceptionListener().exceptionThrown(e);
}
catch (SAXException se) {
Exception e = se.getException();
getExceptionListener().exceptionThrown((e == null) ? se : e);
}
catch (IOException ioe) {
getExceptionListener().exceptionThrown(ioe);
}
}
return handler.dequeueResult();
}
XMLDecoder 对xml文档的解析代码!
最新推荐文章于 2023-06-25 21:15:00 发布