XML 2 Java Binding core class. It binds DOM elements and documents to Java interfaces.
Users use only this class to interact with X2JB runtime.
All methods of this class are thread safe.
Sample usage:
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
// call the following method only when dealing with namespaced document
// otherwise never call it
builderFactory.setNamespaceAware( true );
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document parsedDocument = builder.parse(
new FileInputStream(
new File( "config.xml" ) ) );
Config cfg = ( Config ) XML2Java.bind( parsedDocument, Config.class );
// do something with cfg
author: Richard Opalka version: 1.0 |