javax.xml.stream.XMLResolver.resolveEntity()方法的使用及代码示例

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

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

XMLResolver.resolveEntity介绍

[英]Retrieves a resource. This resource can be of the following three return types: (1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader. If this method returns null the processor will attempt to resolve the entity using its default mechanism.
[中]检索资源。此资源可以是以下三种返回类型:(1)java。伊奥。InputStream(2)javax。xml。流动XMLStreamReader(3)java。xml。流动XMLEventReader。如果此方法返回null,处理器将尝试使用其默认机制解析实体。

代码示例

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

代码示例来源:origin: woodstox/wstx-asl

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

代码示例来源:origin: Nextdoor/bender

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

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

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

代码示例来源:origin: FasterXML/woodstox

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

代码示例来源:origin: woodstox/wstx-lgpl

/**
 * A very simple utility expansion method used generally when the
 * only way to resolve an entity is via passed resolver; and where
 * failing to resolve it is not fatal.
 */
public static WstxInputSource resolveEntityUsing
  (WstxInputSource refCtxt, String entityName,
   String publicId, String systemId,
   XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
  throws IOException, XMLStreamException
{
  URL ctxt = (refCtxt == null) ? null : refCtxt.getSource();
  if (ctxt == null) {
    ctxt = URLUtil.urlFromCurrentDir();
  }
  Object source = resolver.resolveEntity(publicId, systemId, ctxt.toExternalForm(), entityName);
  return (source == null) ? null : sourceFrom(refCtxt, cfg, entityName, xmlVersion, source);
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

public StaxXMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
throws XNIException, java.io.IOException {
  Object object = null ;
  try{
    object = fStaxResolver.resolveEntity(resourceIdentifier.getPublicId(), resourceIdentifier.getLiteralSystemId(),
    resourceIdentifier.getBaseSystemId(), null);
    return getStaxInputSource(object) ;
  }catch(XMLStreamException streamException){
    throw new XNIException(streamException) ;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

public StaxXMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
throws XNIException, java.io.IOException {
  Object object = null ;
  try{
    object = fStaxResolver.resolveEntity(resourceIdentifier.getPublicId(), resourceIdentifier.getLiteralSystemId(),
    resourceIdentifier.getBaseSystemId(), null);
    return getStaxInputSource(object) ;
  }catch(XMLStreamException streamException){
    throw new XNIException(streamException) ;
  }
}

代码示例来源:origin: com.sun.xml.stream/sjsxp

public StaxXMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
throws XNIException, java.io.IOException {
  Object object = null ;
  try{
    object = fStaxResolver.resolveEntity(resourceIdentifier.getPublicId(), resourceIdentifier.getLiteralSystemId(),
    resourceIdentifier.getBaseSystemId(), null);
    return getStaxInputSource(object) ;
  }catch(XMLStreamException streamException){
    throw new XNIException(streamException) ;
  }
}

代码示例来源:origin: woodstox/wstx-asl

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

代码示例来源:origin: FasterXML/woodstox

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

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

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

代码示例来源:origin: woodstox/wstx-lgpl

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

代码示例来源:origin: Nextdoor/bender

Object source = customResolver.resolveEntity(publicId, systemId, pathCtxt.toExternalForm(), entityName);
if (source != null) {
  return sourceFrom(parent, cfg, entityName, xmlVersion, source);

相关文章

XMLResolver类方法