javax.xml.stream.XMLResolver类的使用及代码示例

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

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

XMLResolver介绍

[英]This interface is used to resolve resources during an XML parse. If an application wishes to perform custom entity resolution it must register an instance of this interface with the XMLInputFactory using the setXMLResolver method.
[中]此接口用于在XML解析期间解析资源。如果应用程序希望执行自定义实体解析,则必须使用setXMLResolver方法向XMLInputFactory注册此接口的实例。

代码示例

代码示例来源: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类方法