String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"FEATURE_NOT_SUPPORTED",
new Object[] { name });
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
}
}else if (
name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
//namespace-declaration has effect only if namespaces is true
features =
(short) (state
? features | NSDECL
: features & ~NSDECL);
serializer.fNamespacePrefixes = state;
} else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)
|| name.equalsIgnoreCase(Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
// false is not supported
if (!state) {
String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"FEATURE_NOT_SUPPORTED",
new Object[] { name });
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
}
} else {
String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"FEATURE_NOT_FOUND",
new Object[] { name });
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
}
} else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
if (value == null || value instanceof DOMErrorHandler) {
fErrorHandler = (DOMErrorHandler)value;
} else {
String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
}
} else if (
name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)
|| name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)
|| name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)
|| name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
&& value != null) {
String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"FEATURE_NOT_SUPPORTED",
new Object[] { name });
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
} else {
String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"FEATURE_NOT_FOUND",
new Object[] { name });
throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
}
}