Public Methods | |
| JAXPDOMTestDocumentBuilderFactory (DocumentBuilderFactory baseFactory, 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 () |
Static Public Methods | |
| DocumentBuilderSetting[] | getConfiguration1 () |
| DocumentBuilderSetting[] | getConfiguration2 () |
Definition at line 31 of file JAXPDOMTestDocumentBuilderFactory.java.
|
||||||||||||
|
Creates a JAXP implementation of DOMTestDocumentBuilderFactory.
Definition at line 44 of file JAXPDOMTestDocumentBuilderFactory.java. Referenced by newInstance().
00047 {
00048 super(settings);
00049 if(baseFactory == null) {
00050 factory = DocumentBuilderFactory.newInstance();
00051 }
00052 else {
00053 factory = baseFactory;
00054 }
00055 //
00056 // apply settings to selected document builder
00057 // may throw exception if incompatible
00058 if(settings != null) {
00059 for(int i = 0; i < settings.length; i++) {
00060 settings[i].applySetting(factory);
00061 }
00062 }
00063 try {
00064 this.builder = factory.newDocumentBuilder();
00065 }
00066 catch(ParserConfigurationException ex) {
00067 throw new DOMTestIncompatibleException(ex,null);
00068 }
00069 }
|
|
|
Definition at line 161 of file JAXPDOMTestDocumentBuilderFactory.java. References DocumentBuilderSetting::notCoalescing, DocumentBuilderSetting::notExpandEntityReferences, DocumentBuilderSetting::notIgnoringElementContentWhitespace, DocumentBuilderSetting::notNamespaceAware, and DocumentBuilderSetting::notValidating.
00162 {
00163 return new DocumentBuilderSetting[] {
00164 DocumentBuilderSetting.notCoalescing,
00165 DocumentBuilderSetting.notExpandEntityReferences,
00166 DocumentBuilderSetting.notIgnoringElementContentWhitespace,
00167 DocumentBuilderSetting.notNamespaceAware,
00168 DocumentBuilderSetting.notValidating };
00169 }
|
|
|
Definition at line 171 of file JAXPDOMTestDocumentBuilderFactory.java. References DocumentBuilderSetting::expandEntityReferences, DocumentBuilderSetting::ignoringElementContentWhitespace, DocumentBuilderSetting::namespaceAware, DocumentBuilderSetting::notCoalescing, and DocumentBuilderSetting::validating.
00171 {
00172 return new DocumentBuilderSetting[] {
00173 DocumentBuilderSetting.notCoalescing,
00174 DocumentBuilderSetting.expandEntityReferences,
00175 DocumentBuilderSetting.ignoringElementContentWhitespace,
00176 DocumentBuilderSetting.namespaceAware,
00177 DocumentBuilderSetting.validating };
00178
00179 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 132 of file JAXPDOMTestDocumentBuilderFactory.java.
00132 {
00133 return builder.getDOMImplementation();
00134 }
|
|
||||||||||||
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 136 of file JAXPDOMTestDocumentBuilderFactory.java.
00136 {
00137 return builder.getDOMImplementation().hasFeature(feature,version);
00138 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 141 of file JAXPDOMTestDocumentBuilderFactory.java.
00141 {
00142 return factory.isCoalescing();
00143 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 145 of file JAXPDOMTestDocumentBuilderFactory.java.
00145 {
00146 return factory.isExpandEntityReferences();
00147 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 149 of file JAXPDOMTestDocumentBuilderFactory.java.
00149 {
00150 return factory.isIgnoringElementContentWhitespace();
00151 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 153 of file JAXPDOMTestDocumentBuilderFactory.java.
00153 {
00154 return factory.isNamespaceAware();
00155 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 157 of file JAXPDOMTestDocumentBuilderFactory.java.
00157 {
00158 return factory.isValidating();
00159 }
|
|
|
Reimplemented from DOMTestDocumentBuilderFactory. Definition at line 113 of file JAXPDOMTestDocumentBuilderFactory.java.
00113 {
00114 Document doc = null;
00115 Exception parseException = null;
00116 try {
00117 LoadErrorHandler errorHandler = new LoadErrorHandler();
00118 builder.setErrorHandler(errorHandler);
00119 doc = builder.parse(url.openStream(),url.toString());
00120 parseException = errorHandler.getFirstException();
00121 }
00122 catch(Exception ex) {
00123 parseException = ex;
00124 }
00125 builder.setErrorHandler(null);
00126 if(parseException != null) {
00127 throw new DOMTestLoadException(parseException);
00128 }
00129 return doc;
00130 }
|
|
|
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 71 of file JAXPDOMTestDocumentBuilderFactory.java. References JAXPDOMTestDocumentBuilderFactory(), and DOMTestDocumentBuilderFactory::mergeSettings().
00072 {
00073 if(newSettings == null) {
00074 return this;
00075 }
00076 DocumentBuilderSetting[] mergedSettings = mergeSettings(newSettings);
00077 DocumentBuilderFactory newFactory = factory.newInstance();
00078 return new JAXPDOMTestDocumentBuilderFactory(newFactory,mergedSettings);
00079 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001