Overview
Woodstox classes are loaded using
javax.xml.stream.XMLInputFactory.newInstance()
. The steps involved in loading of Woodstox classes is explained below:
- javax.xml.stream.XMLInputFactory.newInstance() is called by client code
- The file ‘META-INF/services/javax.xml.stream.XMLInputFactory’ is searched in the current classpath
- As the current classpath contains woodstox-core-asl-4.2.0.jar, the file ‘META-INF/services/javax.xml.stream.XMLInputFactory’ is found as shown below
- The contents of ‘META-INF/services/javax.xml.stream.XMLInputFactory’ (as shown below) are read.
- The name of the Woodstox class, WstxInputFactory, mentioned in the above step is read
- WstxInputFactory class is loaded using Java Reflection and returned
In all the sample programs,
WstxInputFactory class is loaded using the above steps.
Other Woodstox classes corresponding to for schema validation (DTD, RelaxNG, W3c),
XMLEventFactory and
XMLOutputFactory (see image in step 3) are loaded in a similar manner as mentioned in the steps above.