Interface SchemaTypeLoader

All Known Subinterfaces:
All Known Implementing Classes:
BuiltinSchemaTypeSystem, SchemaTypeLoaderBase, SchemaTypeLoaderImpl, SchemaTypeSystemImpl, SoapEncSchemaTypeSystem, TypeSystemHolder, TypeSystemHolder, TypeSystemHolder, TypeSystemHolder, TypeSystemHolder, XQuerySchemaTypeSystem

public interface SchemaTypeLoader
Represents a searchable set of XML Schema component definitions.

SchemaTypeLoader is somewhat analogous to 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(java.lang.String, org.apache.xmlbeans.SchemaType, org.apache.xmlbeans.XmlOptions) 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(org.apache.xmlbeans.XmlObject...), or by assembling other SchemaTypeLoaders or SchemaTypeSystems on a path using XmlBeans.typeLoaderUnion(org.apache.xmlbeans.SchemaTypeLoader...).

See Also:
XmlBeans.loadXsd(org.apache.xmlbeans.XmlObject...), XmlBeans.getContextTypeLoader(), XmlBeans.typeLoaderUnion(org.apache.xmlbeans.SchemaTypeLoader...), SchemaTypeSystem