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 () |
Definition at line 32 of file DOM4JTestDocumentBuilderFactory.java.
|
|
Creates a JAXP implementation of DOMTestDocumentBuilderFactory.
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 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 118 of file DOM4JTestDocumentBuilderFactory.java.
00118 {
00119 return domImpl;
00120 }
|
|
||||||||||||
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 122 of file DOM4JTestDocumentBuilderFactory.java.
00122 {
00123 return domImpl.hasFeature(feature,version);
00124 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 126 of file DOM4JTestDocumentBuilderFactory.java.
00126 {
00127 return false;
00128 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 130 of file DOM4JTestDocumentBuilderFactory.java.
00130 {
00131 return false;
00132 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 134 of file DOM4JTestDocumentBuilderFactory.java.
00134 {
00135 return false;
00136 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 138 of file DOM4JTestDocumentBuilderFactory.java.
00138 {
00139 return true;
00140 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 142 of file DOM4JTestDocumentBuilderFactory.java.
00142 {
00143 return false;
00144 }
|
|
|
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 }
|
|
|
Returns an instance of DOMTestDocumentBuilderFactory with the settings from the argument list and any non-revoked settings from the current object.
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 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001