org.xml.sax.helpers.XMLFilterImpl.setParent()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(92)

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

XMLFilterImpl.setParent介绍

[英]Set the parent reader.

This is the org.xml.sax.XMLReader from which this filter will obtain its events and to which it will pass its configuration requests. The parent may itself be another filter.

If there is no parent reader set, any attempt to parse or to set or get a feature or property will fail.
[中]设置父读取器。
这是组织。xml。萨克斯。XMLReader,此筛选器将从中获取其事件,并向其传递其配置请求。父过滤器本身可能是另一个过滤器。
如果没有父读取器集,任何解析、设置或获取功能或属性的尝试都将失败。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Construct an XML filter with the specified parent.
 *
 * @param parent the XML reader from which this filter receives its events.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
setParent(parent);
}

代码示例来源:origin: robovm/robovm

/** Set the parent reader.
 *
 * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which 
 * this filter will obtain its events and to which it will pass its 
 * configuration requests.  The parent may itself be another filter.</p>
 *
 * <p>If there is no parent reader set, any attempt to parse
 * or to set or get a feature or property will fail.</p>
 *
 * @param parent The parent XML reader.
 * @throws java.lang.NullPointerException If the parent is null.
 */
public void setParent (XMLReader parent)
{ 
 super.setParent(parent);
 
 if(null != parent.getContentHandler())
  this.setContentHandler(parent.getContentHandler());
 // Not really sure if we should do this here, but 
 // it seems safer in case someone calls parse() on 
 // the parent.
 setupParse ();
}

代码示例来源:origin: xalan/xalan

/** Set the parent reader.
 *
 * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which 
 * this filter will obtain its events and to which it will pass its 
 * configuration requests.  The parent may itself be another filter.</p>
 *
 * <p>If there is no parent reader set, any attempt to parse
 * or to set or get a feature or property will fail.</p>
 *
 * @param parent The parent XML reader.
 * @throws java.lang.NullPointerException If the parent is null.
 */
public void setParent (XMLReader parent)
{ 
 super.setParent(parent);
 
 if(null != parent.getContentHandler())
  this.setContentHandler(parent.getContentHandler());
 // Not really sure if we should do this here, but 
 // it seems safer in case someone calls parse() on 
 // the parent.
 setupParse ();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Construct an XML filter with the specified parent.
 *
 * @param parent the XML reader from which this filter receives its events.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
setParent(parent);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Construct an XML filter with the specified parent.
 *
 * @param parent the XML reader from which this filter receives its events.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
setParent(parent);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Construct an XML filter with the specified parent.
 *
 * @param parent the XML reader from which this filter receives its events.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
setParent(parent);
}

代码示例来源:origin: javax.xml.parsers/jaxp-api

/**
 * Construct an XML filter with the specified parent.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
  super();
setParent(parent);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Construct an XML filter with the specified parent.
 *
 * @param parent the XML reader from which this filter receives its events.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
setParent(parent);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Construct an XML filter with the specified parent.
 *
 * @param parent the XML reader from which this filter receives its events.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
setParent(parent);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Construct an XML filter with the specified parent.
 *
 * @param parent the XML reader from which this filter receives its events.
 *
 * @see #setParent
 * @see #getParent
 */
public XMLFilterImpl (XMLReader parent)
{
setParent(parent);
}

代码示例来源:origin: com.github.livesense/org.liveSense.service.xssRemove

public void setParent(XMLReader r) {
 super.setParent(r);
}

代码示例来源:origin: OpenAS2/OpenAs2App

public static Document parseXML(InputStream in, XMLFilterImpl handler)
    throws Exception {
  XMLReader xmlparser = XMLReaderFactory.createXMLReader();
  handler.setParent(xmlparser);
  SAXSource source = new SAXSource(handler,new InputSource(in));
  DOMResult result = new DOMResult();
  TransformerFactory tFactory = TransformerFactory.newInstance();
  Transformer transformer = tFactory.newTransformer();
  transformer.transform(source,result);
  return (Document) result.getNode();
}

代码示例来源:origin: xml-resolver/xml-resolver

/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader() {
 super();
 SAXParserFactory spf = SAXParserFactory.newInstance();
 spf.setNamespaceAware(namespaceAware);
 spf.setValidating(validating);
 try {
  SAXParser parser = spf.newSAXParser();
  setParent(parser.getXMLReader());
 } catch (Exception ex) {
  ex.printStackTrace();
 }
}

代码示例来源:origin: xml-resolver/xml-resolver

/**
  * Construct a new reader from the JAXP factory.
  *
  * <p>In order to do its job, a ResolvingXMLReader must in fact be
  * a filter. So the only difference between this code and the filter
  * code is that the constructor builds a new reader.</p>
  */
 public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = SAXParserFactory.newInstance();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
   SAXParser parser = spf.newSAXParser();
   setParent(parser.getXMLReader());
  } catch (Exception ex) {
   ex.printStackTrace();
  }
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver

/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader() {
 super();
 SAXParserFactory spf = SAXParserFactory.newInstance();
 spf.setNamespaceAware(namespaceAware);
 spf.setValidating(validating);
 try {
  SAXParser parser = spf.newSAXParser();
  setParent(parser.getXMLReader());
 } catch (Exception ex) {
  ex.printStackTrace();
 }
}

代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver

/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader() {
 super();
 SAXParserFactory spf = SAXParserFactory.newInstance();
 spf.setNamespaceAware(namespaceAware);
 spf.setValidating(validating);
 try {
  SAXParser parser = spf.newSAXParser();
  setParent(parser.getXMLReader());
 } catch (Exception ex) {
  ex.printStackTrace();
 }
}

代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver

/**
  * Construct a new reader from the JAXP factory.
  *
  * <p>In order to do its job, a ResolvingXMLReader must in fact be
  * a filter. So the only difference between this code and the filter
  * code is that the constructor builds a new reader.</p>
  */
 public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = SAXParserFactory.newInstance();
  spf.setNamespaceAware(namespaceAware);
  spf.setValidating(validating);
  try {
   SAXParser parser = spf.newSAXParser();
   setParent(parser.getXMLReader());
  } catch (Exception ex) {
   ex.printStackTrace();
  }
 }
}

代码示例来源:origin: ibinti/bugvm

/** Set the parent reader.
 *
 * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which 
 * this filter will obtain its events and to which it will pass its 
 * configuration requests.  The parent may itself be another filter.</p>
 *
 * <p>If there is no parent reader set, any attempt to parse
 * or to set or get a feature or property will fail.</p>
 *
 * @param parent The parent XML reader.
 * @throws java.lang.NullPointerException If the parent is null.
 */
public void setParent (XMLReader parent)
{ 
 super.setParent(parent);
 
 if(null != parent.getContentHandler())
  this.setContentHandler(parent.getContentHandler());
 // Not really sure if we should do this here, but 
 // it seems safer in case someone calls parse() on 
 // the parent.
 setupParse ();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xalan

/** Set the parent reader.
 *
 * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which 
 * this filter will obtain its events and to which it will pass its 
 * configuration requests.  The parent may itself be another filter.</p>
 *
 * <p>If there is no parent reader set, any attempt to parse
 * or to set or get a feature or property will fail.</p>
 *
 * @param parent The parent XML reader.
 * @throws java.lang.NullPointerException If the parent is null.
 */
public void setParent (XMLReader parent)
{ 
 super.setParent(parent);
 
 if(null != parent.getContentHandler())
  this.setContentHandler(parent.getContentHandler());
 // Not really sure if we should do this here, but 
 // it seems safer in case someone calls parse() on 
 // the parent.
 setupParse ();
}

代码示例来源:origin: FlexoVM/flexovm

/** Set the parent reader.
 *
 * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which 
 * this filter will obtain its events and to which it will pass its 
 * configuration requests.  The parent may itself be another filter.</p>
 *
 * <p>If there is no parent reader set, any attempt to parse
 * or to set or get a feature or property will fail.</p>
 *
 * @param parent The parent XML reader.
 * @throws java.lang.NullPointerException If the parent is null.
 */
public void setParent (XMLReader parent)
{ 
 super.setParent(parent);
 
 if(null != parent.getContentHandler())
  this.setContentHandler(parent.getContentHandler());
 // Not really sure if we should do this here, but 
 // it seems safer in case someone calls parse() on 
 // the parent.
 setupParse ();
}

相关文章

微信公众号

最新文章

更多