Module java.xml
JAXP Lookup Mechanism
JAXP defines an ordered lookup procedure to determine the implementation class to load for the JAXP factories. Factories that support the mechanism are listed in the table below along with the method, System Property name, Configuration File, and System Default method to be used in the procedure.newInstance(schemaLanguage)
method.
[2] where uri is the parameter to the
newInstance(uri)
method.
jaxp.properties
jaxp.properties is a configuration file in standard
Properties format and typically located in the conf
directory of the Java installation. It contains the fully qualified
name of the implementation class with the key being the system property name
defined in the table above.
The jaxp.properties file is read only once by the implementation and
the values are then cached for future use. If the file does not exist when
the first attempt is made to read from it, no further attempts
are made to check for its existence. It is not possible to change the value
of any property after it has been read for the first time.
stax.properties
stax.properties is a configuration file that functions the same as
jaxp.properties except that it is only used by StAX factory lookup.
Lookup Procedure
The JAXP Factories follow the procedure described below in order to locate and load the implementation class:- Use the system property as described in column System Property of the table JAXP Factories above.
-
Use the configuration file jaxp.properties as indicated in the table JAXP Factories. For StAX, if stax.properties exists, the factories will first attempt to read from it instead of jaxp.properties.
-
Use the service-provider loading facility, defined by the
ServiceLoaderclass, to attempt to locate and load an implementation of the service using the default loading mechanism: the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used.
In case of theSchemaFactorySchemaFactory, each potential service provider is required to implement the methodisSchemaLanguageSupported(String schemaLanguage). The first service provider found that supports the specified schema language is returned.
In case of theXPathFactoryXPathFactory, each potential service provider is required to implement the methodisObjectModelSupported(String objectModel). The first service provider found that supports the specified object model is returned. -
Otherwise, the
system-defaultimplementation is returned, which is equivalent to calling thenewDefaultInstance() or newDefaultFactory()method as shown in column System Default of the table JAXP Factories above.
In case of theSchemaFactorySchemaFactory, there must be a platform defaultSchemaFactoryfor W3C XML Schema.
In case of theXPathFactoryXPathFactory, there must be a platform defaultXPathFactoryfor the W3C DOM, i.e.DEFAULT_OBJECT_MODEL_URI.
- Since:
- 9
-
Packages
ExportsPackageDescriptionDefines constants for XML processing.Provides the classes for implementing XML Catalogs OASIS Standard V1.1, 7 October 2005.Defines XML/Java Type Mappings.Defines XML Namespace processing.Provides the classes for processing XML documents with a SAX (Simple API for XML) parser or a DOM (Document Object Model) Document builder.Defines interfaces and classes for the Streaming API for XML (StAX).Defines event interfaces for the Streaming API for XML (StAX).Provides utility classes for the Streaming API for XML (StAX).Defines the generic APIs for processing transformation instructions, and performing a transformation from source to result.Provides DOM specific transformation classes.Provides SAX specific transformation classes.Provides StAX specific transformation classes.Provides stream and URI specific transformation classes.Provides an API for validation of XML documents.Provides an object-model neutral API for the evaluation of XPath expressions and access to the evaluation environment.Provides the interfaces for the Document Object Model (DOM).Provides a factory for obtaining instances ofDOMImplementation.Provides interfaces for DOM Level 2 Events.Provides interfaces for DOM Level 3 Load and Save.Provides interfaces for DOM Level 2 Range.Provides interfaces for DOM Level 2 Traversal.Provides interfaces for DOM Level 2 Views.Provides the interfaces for the Simple API for XML (SAX).Provides interfaces to SAX2 facilities that conformant SAX drivers won't necessarily support.Provides helper classes, including support for bootstrapping SAX-based applications. -
Services
UsesTypeDescriptionFactory that creates newjavax.xml.datatypeObjects that map XML to/from JavaObjects.Defines a factory API that enables applications to obtain a parser that produces DOM object trees from XML documents.Defines a factory API that enables applications to configure and obtain a SAX based parser to parse XML documents.Factory that createsSchemaobjects.A TransformerFactory instance can be used to createTransformerandTemplatesobjects.This interface defines a utility class for creating instances of XMLEventsDefines an abstract implementation of a factory for getting streams.Defines an abstract implementation of a factory for getting XMLEventWriters and XMLStreamWriters.Interface for reading an XML document using callbacks.AnXPathFactoryinstance can be used to createXPathobjects.