org.apache.xmlbeans.SchemaTypeLoader类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(11.4k)|赞(0)|评价(0)|浏览(175)

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

SchemaTypeLoader介绍

[英]Represents a searchable set of XML Schema component definitions.

SchemaTypeLoader is somewhat analogous to java.lang.ClassLoader, because it is responsible for finding SchemaComponent definitions by name, yet it is not responsible for being able to enumerate all the component definitons available. (If you wish to enumerate component definitions, see SchemaTypeSystem.) There are some ways in which SchemaTypeSystems are dissimilar from ClassLoaders, however. Since XML Schema has a number of instance-oriented typing mechanisms (such as wildcards) that do not exist in Java, a SchemaTypeLoader is not associated with a type; instead, a SchemaTypeLoader is associated with each XML instance.

Every XML instance is loaded within the context of a SchemaTypeLoader; the SchemaTypeLoader for an instance is used to resolve all type definitions within the instance and for applying type-sensitive methods such as XmlObject#validate.

Normally the SchemaTypeLoader being used for all instances is the context type loader (that is, the SchemaTypeLoader returned from XmlBeans#getContextTypeLoader()). The context type loader consults the thread's context ClassLoader (see Thread#getContextClassLoader()) to find schema type defintions that are available on the classpath. The net result is that you can use schema types simply by putting their compiled schema JARs on your classpath. If you wish to load instances using a different SchemaTypeLoader, then you must call #parse methods on the SchemaTypeLoader instance explicitly rather than using the normal convenient Factory methods.

A SchemaTypeLoader can be obtained by dynamically loading XSD files using XmlBeans#loadXsd, or by assembling other SchemaTypeLoaders or SchemaTypeSystems on a path using XmlBeans#typeLoaderUnion.
[中]表示一组可搜索的XML架构组件定义。
SchemaTypeLoader在某种程度上类似于java。因为它负责按名称查找SchemaComponent定义,但不负责枚举所有可用的组件定义。(如果要枚举组件定义,请参阅SchemaTypeSystem。)然而,SchemaTypeSystems在某些方面与类加载器不同。由于XMLSchema有许多Java中不存在的面向实例的类型化机制(如通配符),SchemaTypeLoader与类型没有关联;相反,SchemaTypeLoader与每个XML实例相关联。
每个XML实例都在SchemaTypeLoader的上下文中加载;实例的SchematTypeLoader用于解析实例中的所有类型定义,并用于应用类型敏感的方法,如XmlObject#validate。
通常,用于所有实例的SchemaTypeLoader是上下文类型加载器(即,从XmlBeans#getContextTypeLoader()返回的SchemaTypeLoader)。上下文类型加载器参考线程的上下文类加载器(请参阅线程#getContextClassLoader())以查找类路径上可用的模式类型定义。最终的结果是,只需将已编译的模式JAR放在类路径上,就可以使用模式类型。如果希望使用不同的SchemaTypeLoader加载实例,那么必须显式地调用SchemaTypeLoader实例上的#parse方法,而不是使用普通的方便工厂方法。
SchemaTypeLoader可以通过使用XmlBeans#loadXsd动态加载XSD文件,或者通过使用XmlBeans#typeLoaderUnion在路径上组装其他SchemaTypeLoader或SchemaTypeSystems来获得。

代码示例

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlNormalizedString} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlNormalizedString parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlNormalizedString) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Creates a new, completely empty instance.
 */ 
public static XmlObject newInstance ( ) {
 return XmlBeans.getContextTypeLoader().newInstance( null, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlGYear} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlGYear parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlGYear) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlLong} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlLong parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlLong) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlGDay} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlGDay parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlGDay) XmlBeans.getContextTypeLoader().parse( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlUnsignedShort} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlUnsignedShort parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlUnsignedShort) XmlBeans.getContextTypeLoader().parse( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlDate} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlDate parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlDate) XmlBeans.getContextTypeLoader().parse( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlToken} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlToken parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlToken) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlDecimal} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlDecimal parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlDecimal) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlString} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlString parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlString) XmlBeans.getContextTypeLoader().parse( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Returns a validating XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/** Parses a {@link XmlIDREFS} fragment from an XMLInputStream.
 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
 */
public static XmlIDREFS parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
 return (XmlIDREFS) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }

相关文章

微信公众号

最新文章

更多