本文整理匯總了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());
}
}