com.thoughtworks.xstream.core.JVM.getStaxInputFactory()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(101)

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

JVM.getStaxInputFactory介绍

[英]Get the XMLInputFactory implementation used normally by the current Java runtime as standard.

In contrast to XMLInputFactory.newFactory() this method will ignore any implementations provided with the system property javax.xml.stream.XMLInputFactory, implementations configured in lib/stax.properties or registered with the Service API.
[中]获取当前Java运行时通常使用的XMLInputFactory实现作为标准。
与XMLInputFactory相反。newFactory()此方法将忽略系统属性javax提供的任何实现。xml。流动XMLInputFactory,在lib/stax中配置的实现。属性或向服务API注册。

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

protected XMLInputFactory createInputFactory() {
  Exception exception = null;
  try {
    Class staxInputFactory = JVM.getStaxInputFactory();
    if (staxInputFactory != null) {
      final XMLInputFactory instance = (XMLInputFactory)staxInputFactory.newInstance();
      instance.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
      return instance;
    } else {
      throw new StreamException("Java runtime has no standard XMLInputFactory implementation.", exception);
    }
  } catch (InstantiationException e) {
    exception = e;
  } catch (IllegalAccessException e) {
    exception = e;
  } catch (ClassNotFoundException e) {
    exception = e;
  }
  throw new StreamException("Cannot create standard XMLInputFactory instance of Java runtime.", exception);
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

staxInputFactory = getStaxInputFactory().getName();
} catch (ClassNotFoundException e) {
  staxInputFactory = e.getMessage();

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

protected XMLInputFactory createInputFactory() {
  Exception exception = null;
  try {
    Class staxInputFactory = JVM.getStaxInputFactory();
    if (staxInputFactory != null) {
      final XMLInputFactory instance = (XMLInputFactory)staxInputFactory.newInstance();
      instance.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
      return instance;
    } else {
      throw new StreamException("Java runtime has no standard XMLInputFactory implementation.", exception);
    }
  } catch (InstantiationException e) {
    exception = e;
  } catch (IllegalAccessException e) {
    exception = e;
  } catch (ClassNotFoundException e) {
    exception = e;
  }
  throw new StreamException("Cannot create standard XMLInputFactory instance of Java runtime.", exception);
}

代码示例来源:origin: x-stream/xstream

@Override
protected XMLInputFactory createInputFactory() {
  Exception exception = null;
  try {
    final Class<? extends XMLInputFactory> staxInputFactory = JVM.getStaxInputFactory();
    if (staxInputFactory != null) {
      final XMLInputFactory instance = staxInputFactory.newInstance();
      instance.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
      return instance;
    } else {
      throw new StreamException("Java runtime has no standard XMLInputFactory implementation.", exception);
    }
  } catch (final InstantiationException e) {
    exception = e;
  } catch (final IllegalAccessException e) {
    exception = e;
  } catch (final ClassNotFoundException e) {
    exception = e;
  }
  throw new StreamException("Cannot create standard XMLInputFactory instance of Java runtime.", exception);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

protected XMLInputFactory createInputFactory() {
  Exception exception = null;
  try {
    Class staxInputFactory = JVM.getStaxInputFactory();
    if (staxInputFactory != null) {
      final XMLInputFactory instance = (XMLInputFactory)staxInputFactory.newInstance();
      instance.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
      return instance;
    } else {
      throw new StreamException("Java runtime has no standard XMLInputFactory implementation.", exception);
    }
  } catch (InstantiationException e) {
    exception = e;
  } catch (IllegalAccessException e) {
    exception = e;
  } catch (ClassNotFoundException e) {
    exception = e;
  }
  throw new StreamException("Cannot create standard XMLInputFactory instance of Java runtime.", exception);
}

代码示例来源:origin: apache/servicemix-bundles

protected XMLInputFactory createInputFactory() {
  Exception exception = null;
  try {
    Class staxInputFactory = JVM.getStaxInputFactory();
    if (staxInputFactory != null) {
      final XMLInputFactory instance = (XMLInputFactory)staxInputFactory.newInstance();
      instance.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
      return instance;
    } else {
      throw new StreamException("Java runtime has no standard XMLInputFactory implementation.", exception);
    }
  } catch (InstantiationException e) {
    exception = e;
  } catch (IllegalAccessException e) {
    exception = e;
  } catch (ClassNotFoundException e) {
    exception = e;
  }
  throw new StreamException("Cannot create standard XMLInputFactory instance of Java runtime.", exception);
}

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

protected XMLInputFactory createInputFactory() {
  Exception exception = null;
  try {
    Class staxInputFactory = JVM.getStaxInputFactory();
    if (staxInputFactory != null) {
      return (XMLInputFactory)staxInputFactory.newInstance();
    } else {
      throw new StreamException("Java runtime has no standard XMLInputFactory implementation.", exception);
    }
  } catch (InstantiationException e) {
    exception = e;
  } catch (IllegalAccessException e) {
    exception = e;
  } catch (ClassNotFoundException e) {
    exception = e;
  }
  throw new StreamException("Cannot create standard XMLInputFactory instance of Java runtime.", exception);
}

代码示例来源:origin: x-stream/xstream

staxInputFactory = getStaxInputFactory().getName();
} catch (final ClassNotFoundException e) {
  staxInputFactory = e.getMessage();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

staxInputFactory = getStaxInputFactory().getName();
} catch (ClassNotFoundException e) {
  staxInputFactory = e.getMessage();

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

staxInputFactory = getStaxInputFactory().getName();
} catch (ClassNotFoundException e) {
  staxInputFactory = e.getMessage();

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

staxInputFactory = getStaxInputFactory().getName();
} catch (ClassNotFoundException e) {
  staxInputFactory = e.getMessage();

代码示例来源:origin: apache/servicemix-bundles

staxInputFactory = getStaxInputFactory().getName();
} catch (ClassNotFoundException e) {
  staxInputFactory = e.getMessage();

相关文章