Code example for DOMConfiguration

Methods: canSetParameter, getParameter, setParameter

0
    } 
 
    private void assertUnsupported(String name, Object value) {
        String message = "This implementation's setParameter() supports an unexpected value: "
                + name + "=" + value;
        assertFalse(message, domConfiguration.canSetParameter(name, value));
        try { 
            domConfiguration.setParameter(name, value);
            fail(message);
        } catch (DOMException e) {
            assertEquals(DOMException.NOT_SUPPORTED_ERR, e.code);
        } 
        try { 
            domConfiguration.setParameter(name.toUpperCase(), value);
            fail(message);
        } catch (DOMException e) {
            assertEquals(DOMException.NOT_SUPPORTED_ERR, e.code);
        } 
        assertFalse(value.equals(domConfiguration.getParameter(name)));
    } 
 
    private void assertSupported(String name, Object value) {
        String message = "This implementation's canSetParameter() disagrees"
                + " with its setParameter() for " + name + "=" + value;