org.ccil.cowan.tagsoup.Parser.setContentHandler()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.ccil.cowan.tagsoup.Parser.setContentHandler()方法的一些代码示例,展示了Parser.setContentHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.setContentHandler()方法的具体详情如下:
包路径:org.ccil.cowan.tagsoup.Parser
类名称:Parser
方法名:setContentHandler

Parser.setContentHandler介绍

暂无

代码示例

代码示例来源:origin: apache/tika

parser.setContentHandler(handler);
parser.parse(new InputSource(new StringReader(codeAsHtml)));

代码示例来源:origin: apache/tika

org.ccil.cowan.tagsoup.Parser.ignoreBogonsFeature, true);
parser.setContentHandler(new XHTMLDowngradeHandler(
    new HtmlHandler(mapper, handler, metadata, context, extractScripts)));

代码示例来源:origin: fourlastor/dante

@Override public void parse(String string) {
  org.ccil.cowan.tagsoup.Parser parser = new org.ccil.cowan.tagsoup.Parser();
  parser.setContentHandler(this);
  try {
    parser.parse(new InputSource(new StringReader(string)));
  } catch (IOException | SAXException e) {
    throw new HtmlParsingException(e);
  }
  emptyBuffer();
}

代码示例来源:origin: gamesbyangelina/spritely

"http://www.colourlovers.com/ajax/search-palettes/_page_1?sortCol=votes&sortBy=desc&query="
        + query);
p.setContentHandler(handler);
p.parse(new InputSource(u.openStream()));
  p.setContentHandler(pandler);
  p.parse(new InputSource(new URL(s).openStream()));

代码示例来源:origin: gamesbyangelina/spritely

p.setContentHandler(scraper);

代码示例来源:origin: org.apache.tika/tika-parsers

parser.setContentHandler(handler);
parser.parse(new InputSource(new StringReader(codeAsHtml)));

代码示例来源:origin: net.sf.ofx4j/ofx4j

public void parseV1FromFirstElement(Reader reader) throws IOException, OFXParseException {
 Parser parser = new Parser();
 try {
  parser.setFeature(Parser.restartElementsFeature, false);
 }
 catch (Exception e) {
  throw new OFXParseException(e);
 }
 parser.setContentHandler(new TagSoupHandler(getContentHandler()));
 try {
  parser.parse(new InputSource(reader));
 }
 catch (SAXException e) {
  if (e.getCause() instanceof OFXParseException) {
   throw (OFXParseException) e.getCause();
  }
  
  throw new OFXParseException("Error parsing OFX document.", e);
 }
}

代码示例来源:origin: stoicflame/ofx4j

public void parseV1FromFirstElement(Reader reader) throws IOException, OFXParseException {
 Parser parser = new Parser();
 try {
  parser.setFeature(Parser.restartElementsFeature, false);
 }
 catch (Exception e) {
  throw new OFXParseException(e);
 }
 parser.setContentHandler(new TagSoupHandler(getContentHandler()));
 try {
  parser.parse(new InputSource(reader));
 }
 catch (SAXException e) {
  if (e.getCause() instanceof OFXParseException) {
   throw (OFXParseException) e.getCause();
  }
  
  throw new OFXParseException("Error parsing OFX document.", e);
 }
}

代码示例来源:origin: org.apache.tika/tika-parsers

org.ccil.cowan.tagsoup.Parser.ignoreBogonsFeature, true);
parser.setContentHandler(new XHTMLDowngradeHandler(
    new HtmlHandler(mapper, handler, metadata, context, extractScripts)));

相关文章