gpt4 book ai didi

org.apache.commons.jelly.parser.XMLParser.getParser()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 11:15:05 25 4
gpt4 key购买 nike

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

XMLParser.getParser介绍

[英]Return the SAXParser we will use to parse the input stream. If there is a problem creating the parser, return null.
[中]返回用于解析输入流的SAXParser。如果创建解析器时出现问题,请返回null

代码示例

代码示例来源:origin: org.jenkins-ci/commons-jelly

/**
 * Return the XMLReader to be used for parsing the input document.
 *
 * @exception SAXException if no XMLReader can be instantiated
 */
public synchronized XMLReader getXMLReader() throws SAXException {
  if (reader == null) {
    reader = getParser().getXMLReader();
    // while this is supposed to be false by default, some parsers
    // (in particular Oracle XML parser in oc4j 10.1.3.1) sets the incorrect default value,
    // so make sure we got the right value.
    reader.setFeature("http://xml.org/sax/features/namespace-prefixes",false);
    if (this.defaultNamespaceURI != null) {
      reader = new DefaultNamespaceFilter(this.defaultNamespaceURI,reader);
    }
  }
  //set up the parse
  reader.setContentHandler(this);
  reader.setDTDHandler(this);
  //reader.setEntityResolver(this);
  reader.setErrorHandler(this);
  return reader;
}

代码示例来源:origin: commons-jelly/commons-jelly

/**
 * Return the XMLReader to be used for parsing the input document.
 *
 * @exception SAXException if no XMLReader can be instantiated
 */
public synchronized XMLReader getXMLReader() throws SAXException {
  if (reader == null) {
    reader = getParser().getXMLReader();
    if (!allowDtdToCallExternalEntities) {
      reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
      reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
      reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    }
    if (this.defaultNamespaceURI != null) {
      reader = new DefaultNamespaceFilter(this.defaultNamespaceURI,reader);
    }
  }
  //set up the parse
  reader.setContentHandler(this);
  reader.setDTDHandler(this);
  //reader.setEntityResolver(this);
  reader.setErrorHandler(this);
  return reader;
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

/**
 * Return the XMLReader to be used for parsing the input document.
 *
 * @exception SAXException if no XMLReader can be instantiated
 */
public synchronized XMLReader getXMLReader() throws SAXException {
  if (reader == null) {
    reader = getParser().getXMLReader();
    // while this is supposed to be false by default, some parsers
    // (in particular Oracle XML parser in oc4j 10.1.3.1) sets the incorrect default value,
    // so make sure we got the right value.
    reader.setFeature("http://xml.org/sax/features/namespace-prefixes",false);
    if (this.defaultNamespaceURI != null) {
      reader = new DefaultNamespaceFilter(this.defaultNamespaceURI,reader);
    }
  }
  //set up the parse
  reader.setContentHandler(this);
  reader.setDTDHandler(this);
  //reader.setEntityResolver(this);
  reader.setErrorHandler(this);
  return reader;
}

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

/**
 * Return the XMLReader to be used for parsing the input document.
 *
 * @exception SAXException if no XMLReader can be instantiated
 */
public synchronized XMLReader getXMLReader() throws SAXException {
  if (reader == null) {
    reader = getParser().getXMLReader();
    // while this is supposed to be false by default, some parsers
    // (in particular Oracle XML parser in oc4j 10.1.3.1) sets the incorrect default value,
    // so make sure we got the right value.
    reader.setFeature("http://xml.org/sax/features/namespace-prefixes",false);
    if (this.defaultNamespaceURI != null) {
      reader = new DefaultNamespaceFilter(this.defaultNamespaceURI,reader);
    }
  }
  //set up the parse
  reader.setContentHandler(this);
  reader.setDTDHandler(this);
  //reader.setEntityResolver(this);
  reader.setErrorHandler(this);
  return reader;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com