Main Page Packages Class Hierarchy Compound List File List Compound Members

# DOM4JTestDocumentBuilderFactory Class Reference

Inherits DOMTestDocumentBuilderFactory.

List of all members.

## Public Methods
| DOM4JTestDocumentBuilderFactory (DocumentBuilderSetting[] settings) throws DOMTestIncompatibleException
DOMTestDocumentBuilderFactory | newInstance (DocumentBuilderSetting[] newSettings) throws DOMTestIncompatibleException
Document | load (java.net.URL url) throws DOMTestLoadException
DOMImplementation | getDOMImplementation ()
boolean | hasFeature (String feature, String version)
boolean | isCoalescing ()
boolean | isExpandEntityReferences ()
boolean | isIgnoringElementContentWhitespace ()
boolean | isNamespaceAware ()
boolean | isValidating ()

## Detailed Description

This class implements the generic parser and configuation abstract class for JAXP supporting parsers.

Definition at line 32 of file DOM4JTestDocumentBuilderFactory.java.

## Constructor & Destructor Documentation

DOM4JTestDocumentBuilderFactory::DOM4JTestDocumentBuilderFactory | ( | DocumentBuilderSetting | settings[] | ) | `[inline]`

  | Creates a JAXP implementation of DOMTestDocumentBuilderFactory. Parameters:
  factory | null for default JAXP provider. If not null, factory will be mutated in constructor and should be released by calling code upon return.
  XMLReader | if null use default XMLReader. If provided, it may be mutated and should be released by the caller immediately after the constructor.
  settings | array of settings, may be null.
Definition at line 51 of file DOM4JTestDocumentBuilderFactory.java.
    00052                                         {
    00053     super(settings);
    00054     try {
    00055       //
    00056       //   The following reflection code is trying to accomplish
    00057       //
    00058       //domFactory = org.dom4j.dom.DOMDocumentFactory.getInstance();
    00059       //domImpl = (DOMImplementation) domFactory;
    00060       //saxReader = new org.dom4j.io.SAXReader(domFactory);
    00061       //xmlReader = saxReader.getXMLReader();
    00062
    00063       ClassLoader classLoader = ClassLoader.getSystemClassLoader();
    00064       Class domFactoryClass = classLoader.loadClass("org.dom4j.dom.DOMDocumentFactory");
    00065       Method getInstance = domFactoryClass.getMethod("getInstance", new Class[] {});
    00066       domFactory = getInstance.invoke(null,new Object[] {});
    00067       domImpl = (DOMImplementation) domFactory;
    00068       Class saxReaderClass = classLoader.loadClass("org.dom4j.io.SAXReader");
    00069       Constructor saxReaderConstructor = saxReaderClass.getConstructor(
    00070         new Class[] { classLoader.loadClass("org.dom4j.DocumentFactory") });
    00071       saxReader = saxReaderConstructor.newInstance(new Object[] { domFactory } );
    00072
    00073       Method getReaderMethod = saxReaderClass.getMethod("getXMLReader", new Class[] {});
    00074       xmlReader = (XMLReader) getReaderMethod.invoke(saxReader, new Object[0]);
    00075
    00076       readMethod = saxReaderClass.getMethod("read",new Class[] { java.net.URL.class } );
    00077     }
    00078     catch(InvocationTargetException ex) {
    00079       throw new DOMTestIncompatibleException(ex.getTargetException(),null);
    00080     }
    00081     catch(Exception ex) {
    00082       throw new DOMTestIncompatibleException(ex,null);
    00083     }
    00084     //
    00085     //   TODO: Process settings
    00086     //
    00087   }

## Member Function Documentation

DOMImplementation DOM4JTestDocumentBuilderFactory::getDOMImplementation | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 118 of file DOM4JTestDocumentBuilderFactory.java.
    00118                                                   {
    00119     return domImpl;
    00120   }

boolean DOM4JTestDocumentBuilderFactory::hasFeature | ( | String | feature,
|  | String | version
| ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 122 of file DOM4JTestDocumentBuilderFactory.java.
    00122                                                             {
    00123     return domImpl.hasFeature(feature,version);
    00124   }

boolean DOM4JTestDocumentBuilderFactory::isCoalescing | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 126 of file DOM4JTestDocumentBuilderFactory.java.
    00126                                   {
    00127       return false;
    00128     }

boolean DOM4JTestDocumentBuilderFactory::isExpandEntityReferences | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 130 of file DOM4JTestDocumentBuilderFactory.java.
    00130                                               {
    00131       return false;
    00132     }

boolean DOM4JTestDocumentBuilderFactory::isIgnoringElementContentWhitespace | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 134 of file DOM4JTestDocumentBuilderFactory.java.
    00134                                                         {
    00135       return false;
    00136     }

boolean DOM4JTestDocumentBuilderFactory::isNamespaceAware | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 138 of file DOM4JTestDocumentBuilderFactory.java.
    00138                                       {
    00139       return true;
    00140     }

boolean DOM4JTestDocumentBuilderFactory::isValidating | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 142 of file DOM4JTestDocumentBuilderFactory.java.
    00142                                   {
    00143       return false;
    00144     }

Document DOM4JTestDocumentBuilderFactory::load | ( | java.net.URL | url | ) | `[inline, virtual]`

| Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 98 of file DOM4JTestDocumentBuilderFactory.java.
    00098                                                                      {
    00099     if(url == null) {
    00100         throw new NullPointerException("url");
    00101     }
    00102     if(saxReader == null) {
    00103         throw new NullPointerException("saxReader");
    00104     }
    00105     try {
    00106       return (org.w3c.dom.Document) readMethod.invoke(saxReader, new Object[] { url });
    00107     }
    00108     catch(InvocationTargetException ex) {
    00109       ex.getTargetException().printStackTrace();
    00110       throw new DOMTestLoadException(ex.getTargetException());
    00111     }
    00112     catch(Exception ex) {
    00113       ex.printStackTrace();
    00114       throw new DOMTestLoadException(ex);
    00115     }
    00116   }

DOMTestDocumentBuilderFactory DOM4JTestDocumentBuilderFactory::newInstance | ( | DocumentBuilderSetting | newSettings[] | ) | `[inline, virtual]`

  | Returns an instance of DOMTestDocumentBuilderFactory with the settings from the argument list and any non-revoked settings from the current object. Parameters:
  settings | array of settings, may be null.
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 89 of file DOM4JTestDocumentBuilderFactory.java.
    00090                                         {
    00091     if(newSettings == null) {
    00092       return this;
    00093     }
    00094     DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
    00095     return new DOM4JTestDocumentBuilderFactory(mergedSettings);
    00096   }

The documentation for this class was generated from the following file:

- DOM4JTestDocumentBuilderFactory.java