本文整理汇总了Java中jdk.internal.org.xml.sax.XMLReader类的典型用法代码示例。如果您正苦于以下问题:Java XMLReader类的具体用法?Java XMLReader怎么用?Java XMLReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLReader类属于jdk.internal.org.xml.sax包,在下文中一共展示了XMLReader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parse
import jdk.internal.org.xml.sax.XMLReader; //导入依赖的package包/类
/**
* Parse the content given {@link org.xml.sax.InputSource}
* as XML using the specified
* {@link org.xml.sax.helpers.DefaultHandler}.
*
* @param is The InputSource containing the content to be parsed.
* @param dh The SAX DefaultHandler to use.
*
* @throws IllegalArgumentException If the <code>InputSource</code> object
* is <code>null</code>.
* @throws IOException If any IO errors occur.
* @throws SAXException If any SAX errors occur during processing.
*
* @see org.xml.sax.DocumentHandler
*/
public void parse(InputSource is, DefaultHandler dh)
throws SAXException, IOException
{
if (is == null) {
throw new IllegalArgumentException("InputSource cannot be null");
}
XMLReader reader = this.getXMLReader();
if (dh != null) {
reader.setContentHandler(dh);
reader.setEntityResolver(dh);
reader.setErrorHandler(dh);
reader.setDTDHandler(dh);
}
reader.parse(is);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:SAXParser.java
示例2: getXMLReader
import jdk.internal.org.xml.sax.XMLReader; //导入依赖的package包/类
/**
* Returns the {@link org.xml.sax.XMLReader} that is encapsulated by the
* implementation of this class.
*
* @return The XMLReader that is encapsulated by the
* implementation of this class.
*
* @throws SAXException If any SAX errors occur during processing.
*/
public abstract XMLReader getXMLReader() throws SAXException;
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SAXParser.java
示例3: getXMLReader
import jdk.internal.org.xml.sax.XMLReader; //导入依赖的package包/类
/**
* Returns the {@link org.xml.sax.XMLReader} that is encapsulated by the
* implementation of this class.
*
* @return The XMLReader that is encapsulated by the
* implementation of this class.
*
* @throws SAXException If any SAX errors occur during processing.
*/
public XMLReader getXMLReader()
throws SAXException {
return parser;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:SAXParserImpl.java
注:本文中的jdk.internal.org.xml.sax.XMLReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论