Main Page Packages Class Hierarchy Compound List File List Compound Members

# DOMTestDocumentBuilderFactory Class Reference

Inherited by BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory.

List of all members.

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

## Detailed Description

This class represents a particular parser and configuration (such as entity-expanding, non-validating, whitespace ignoring) for a test session. Individual tests or suites within a session can override the session properties on a call to createBuilderFactory.

Author:
  Curt Arnold

Definition at line 47 of file DOMTestDocumentBuilderFactory.java.

## Constructor & Destructor Documentation

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

  | Constructor Parameters:
  properties | Array of parser settings, may be null.
Definition at line 58 of file DOMTestDocumentBuilderFactory.java.
    00059                                         {
    00060     if(settings == null) {
    00061         this.settings = new DocumentBuilderSetting[0];
    00062     }
    00063     else {
    00064         this.settings = (DocumentBuilderSetting[]) settings.clone();
    00065     }
    00066   }

## Member Function Documentation

String DOMTestDocumentBuilderFactory::addExtension | ( | String | testFileName | ) | `[inline]`

| Reimplemented in BatikTestDocumentBuilderFactory. Definition at line 128 of file DOMTestDocumentBuilderFactory.java. Referenced by DOMTest::load().
    00128                                                     {
    00129         return testFileName + ".xml";
    00130     }

final DocumentBuilderSetting [] DOMTestDocumentBuilderFactory::getActualSettings | ( |  | ) | `[inline]`

  | Creates an array of all determinable settings for the DocumentBuilder including those at implementation defaults. Parameters:
  builder | must not be null
Definition at line 147 of file DOMTestDocumentBuilderFactory.java. References DocumentBuilderSetting::coalescing, DocumentBuilderSetting::expandEntityReferences, DocumentBuilderSetting::hasNullString, DocumentBuilderSetting::hasSetting(), DocumentBuilderSetting::ignoringElementContentWhitespace, DocumentBuilderSetting::namespaceAware, DocumentBuilderSetting::notCoalescing, DocumentBuilderSetting::notExpandEntityReferences, DocumentBuilderSetting::notHasNullString, DocumentBuilderSetting::notIgnoringElementContentWhitespace, DocumentBuilderSetting::notNamespaceAware, DocumentBuilderSetting::notSigned, DocumentBuilderSetting::notValidating, DocumentBuilderSetting::signed, and DocumentBuilderSetting::validating.
    00147                                                             {
    00148
    00149     DocumentBuilderSetting[] allSettings = new DocumentBuilderSetting[] {
    00150       DocumentBuilderSetting.coalescing,
    00151       DocumentBuilderSetting.expandEntityReferences,
    00152       DocumentBuilderSetting.hasNullString,
    00153       DocumentBuilderSetting.ignoringElementContentWhitespace,
    00154       DocumentBuilderSetting.namespaceAware,
    00155       DocumentBuilderSetting.signed,
    00156       DocumentBuilderSetting.validating,
    00157       DocumentBuilderSetting.notCoalescing,
    00158       DocumentBuilderSetting.notExpandEntityReferences,
    00159       DocumentBuilderSetting.notHasNullString,
    00160       DocumentBuilderSetting.notIgnoringElementContentWhitespace,
    00161       DocumentBuilderSetting.notNamespaceAware,
    00162       DocumentBuilderSetting.notSigned,
    00163       DocumentBuilderSetting.notValidating
    00164       };
    00165
    00166       List list = new ArrayList(allSettings.length /2);
    00167       for(int i = 0; i < allSettings.length; i++) {
    00168         if(allSettings[i].hasSetting(this)) {
    00169           list.add(allSettings[i]);
    00170         }
    00171       }
    00172       DocumentBuilderSetting[] settings = new DocumentBuilderSetting[list.size()];
    00173       for(int i = 0; i < settings.length; i++) {
    00174         settings[i] = (DocumentBuilderSetting) list.get(i);
    00175       }
    00176       return settings;
    00177   }

abstract DOMImplementation DOMTestDocumentBuilderFactory::getDOMImplementation | ( |  | ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory.

abstract boolean DOMTestDocumentBuilderFactory::hasFeature | ( | String | feature,
|  | String | version
| ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory. Referenced by DOMTest::hasFeature().

abstract boolean DOMTestDocumentBuilderFactory::isCoalescing | ( |  | ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory. Referenced by DOMTest::isCoalescing().

abstract boolean DOMTestDocumentBuilderFactory::isExpandEntityReferences | ( |  | ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory. Referenced by DOMTest::isExpandEntityReferences().

abstract boolean DOMTestDocumentBuilderFactory::isIgnoringElementContentWhitespace | ( |  | ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory. Referenced by DOMTest::isIgnoringElementContentWhitespace().

abstract boolean DOMTestDocumentBuilderFactory::isNamespaceAware | ( |  | ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory. Referenced by DOMTest::isNamespaceAware().

abstract boolean DOMTestDocumentBuilderFactory::isValidating | ( |  | ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory. Referenced by DOMTest::isValidating().

abstract Document DOMTestDocumentBuilderFactory::load | ( | java.net.URL | url | ) | `[pure virtual]`

| Reimplemented in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory. Referenced by DOMTest::load().

DocumentBuilderSetting [] DOMTestDocumentBuilderFactory::mergeSettings | ( | DocumentBuilderSetting | newSettings[] | ) | `[inline, protected]`

  | Merges the settings from the specific test case or suite with the existing (typically session) settings. Parameters:
  settings | new settings, may be null which will return clone of existing settings.
Definition at line 89 of file DOMTestDocumentBuilderFactory.java. References DocumentBuilderSetting::hasConflict(). Referenced by JAXPDOMTestDocumentBuilderFactory::newInstance(), and BatikTestDocumentBuilderFactory::newInstance().
    00090   {
    00091       if(newSettings == null) {
    00092         return (DocumentBuilderSetting[]) settings.clone();
    00093       }
    00094       List mergedSettings = new ArrayList(settings.length + newSettings.length);
    00095       //
    00096       //    all new settings are respected
    00097       //
    00098       for(int i = 0; i < newSettings.length; i++) {
    00099         mergedSettings.add(newSettings[i]);
    00100       }
    00101       //
    00102       //    for all previous settings, take only those that
    00103       //       do not conflict with existing settings
    00104       for(int i = 0; i < settings.length; i++) {
    00105         DocumentBuilderSetting setting = settings[i];
    00106         boolean hasConflict = false;
    00107         for(int j = 0; j < newSettings.length; j++) {
    00108           DocumentBuilderSetting newSetting = newSettings[j];
    00109           if(newSetting.hasConflict(setting) || setting.hasConflict(newSetting)) {
    00110             hasConflict = true;
    00111             break;
    00112           }
    00113         }
    00114         if(!hasConflict) {
    00115           mergedSettings.add(setting);
    00116         }
    00117       }
    00118
    00119       DocumentBuilderSetting[] mergedArray =
    00120         new DocumentBuilderSetting[mergedSettings.size()];
    00121       for(int i = 0; i < mergedSettings.size(); i++) {
    00122         mergedArray[i] = (DocumentBuilderSetting) mergedSettings.get(i);
    00123       }
    00124       return mergedArray;
    00125     }

abstract DOMTestDocumentBuilderFactory DOMTestDocumentBuilderFactory::newInstance | ( | DocumentBuilderSetting | newSettings[] | ) | `[pure 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 in BatikTestDocumentBuilderFactory, DOM4JTestDocumentBuilderFactory, and JAXPDOMTestDocumentBuilderFactory.

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

- DOMTestDocumentBuilderFactory.java