Methods Summary |
---|
public java.lang.String | addExtension(java.lang.String testFileName)
String contentType = getContentType();
if ("text/html".equals(contentType)) {
return testFileName + ".html";
}
if ("image/svg+xml".equals(contentType)) {
return testFileName + ".svg";
}
if ("application/xhtml+xml".equals(contentType)) {
return testFileName + ".xhtml";
}
return testFileName + ".xml";
|
public java.lang.Object | createXPathEvaluator(org.w3c.dom.Document doc)Creates XPath evaluator
try {
Method getFeatureMethod = doc.getClass().getMethod("getFeature",
new Class[] {String.class, String.class});
if (getFeatureMethod != null) {
return getFeatureMethod.invoke(doc, new Object[] {"XPath", null});
}
}
catch (Exception ex) {
}
return doc;
|
public final DocumentBuilderSetting[] | getActualSettings()Creates an array of all determinable settings for the DocumentBuilder
including those at implementation defaults.
DocumentBuilderSetting[] allSettings = new DocumentBuilderSetting[] {
DocumentBuilderSetting.coalescing,
DocumentBuilderSetting.expandEntityReferences,
DocumentBuilderSetting.hasNullString,
DocumentBuilderSetting.ignoringElementContentWhitespace,
DocumentBuilderSetting.namespaceAware,
DocumentBuilderSetting.signed,
DocumentBuilderSetting.validating,
DocumentBuilderSetting.notCoalescing,
DocumentBuilderSetting.notExpandEntityReferences,
DocumentBuilderSetting.notHasNullString,
DocumentBuilderSetting.notIgnoringElementContentWhitespace,
DocumentBuilderSetting.notNamespaceAware,
DocumentBuilderSetting.notSigned,
DocumentBuilderSetting.notValidating
};
List list = new ArrayList(allSettings.length / 2);
for (int i = 0; i < allSettings.length; i++) {
if (allSettings[i].hasSetting(this)) {
list.add(allSettings[i]);
}
}
DocumentBuilderSetting[] settings = new DocumentBuilderSetting[list.size()];
for (int i = 0; i < settings.length; i++) {
settings[i] = (DocumentBuilderSetting) list.get(i);
}
return settings;
|
public java.lang.String | getContentType()
return System.getProperty("org.w3c.domts.contentType", "text/xml");
|
public abstract org.w3c.dom.DOMImplementation | getDOMImplementation()
|
public abstract boolean | hasFeature(java.lang.String feature, java.lang.String version)
|
public abstract boolean | isCoalescing()
|
public abstract boolean | isExpandEntityReferences()
|
public abstract boolean | isIgnoringElementContentWhitespace()
|
public abstract boolean | isNamespaceAware()
|
public abstract boolean | isValidating()
|
public abstract org.w3c.dom.Document | load(java.net.URL url)
|
protected DocumentBuilderSetting[] | mergeSettings(DocumentBuilderSetting[] newSettings)Merges the settings from the specific test case or suite
with the existing (typically session) settings.
if (newSettings == null) {
return (DocumentBuilderSetting[]) settings.clone();
}
List mergedSettings = new ArrayList(settings.length + newSettings.length);
//
// all new settings are respected
//
for (int i = 0; i < newSettings.length; i++) {
mergedSettings.add(newSettings[i]);
}
//
// for all previous settings, take only those that
// do not conflict with existing settings
for (int i = 0; i < settings.length; i++) {
DocumentBuilderSetting setting = settings[i];
boolean hasConflict = false;
for (int j = 0; j < newSettings.length; j++) {
DocumentBuilderSetting newSetting = newSettings[j];
if (newSetting.hasConflict(setting) || setting.hasConflict(newSetting)) {
hasConflict = true;
break;
}
}
if (!hasConflict) {
mergedSettings.add(setting);
}
}
DocumentBuilderSetting[] mergedArray =
new DocumentBuilderSetting[mergedSettings.size()];
for (int i = 0; i < mergedSettings.size(); i++) {
mergedArray[i] = (DocumentBuilderSetting) mergedSettings.get(i);
}
return mergedArray;
|
public abstract org.w3c.domts.DOMTestDocumentBuilderFactory | newInstance(DocumentBuilderSetting[] settings)Returns an instance of DOMTestDocumentBuilderFactory
with the settings from the argument list
and any non-revoked settings from the current object.
|