本文整理汇总了Java中org.apache.harmony.xml.ExpatReader类的典型用法代码示例。如果您正苦于以下问题:Java ExpatReader类的具体用法?Java ExpatReader怎么用?Java ExpatReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExpatReader类属于org.apache.harmony.xml包,在下文中一共展示了ExpatReader类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import org.apache.harmony.xml.ExpatReader; //导入依赖的package包/类
/**
* Parses the given xml string and fires events on the given SAX handler.
*/
public static void parse(String xml, ContentHandler contentHandler)
throws SAXException {
try {
XMLReader reader = new ExpatReader();
reader.setContentHandler(contentHandler);
reader.parse(new InputSource(new StringReader(xml)));
} catch (IOException e) {
throw new AssertionError(e);
}
}
示例2: resetInternal
import org.apache.harmony.xml.ExpatReader; //导入依赖的package包/类
private void resetInternal()
throws SAXNotSupportedException, SAXNotRecognizedException {
reader = new ExpatReader();
for (Map.Entry<String,Boolean> entry : initialFeatures.entrySet()) {
reader.setFeature(entry.getKey(), entry.getValue());
}
}