Java Code Examples for org.xml.sax.helpers.AttributesImpl.removeAttribute()

The following are Jave code examples for showing how to use removeAttribute() of the org.xml.sax.helpers.AttributesImpl class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File: AttrImplTest.java   View Source Code Vote up 5 votes
/**
 * Javadoc says getLocalName returns null if the index if out of range.
 */
@Test
public void testcase09() {
    AttributesImpl attr = new AttributesImpl();
    attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
    attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
            JEEP_VALUE);
    attr.removeAttribute(1);
    assertNull(attr.getLocalName(1));
}
 
Example 2
Project: openjdk-jdk10   File: AttrImplTest.java   View Source Code Vote up 5 votes
/**
 * Javadoc says java.lang.ArrayIndexOutOfBoundsException is thrown When the
 * supplied index does not point to an attribute in the list.
 */
@Test(expectedExceptions = ArrayIndexOutOfBoundsException.class)
public void testcase10() {
    AttributesImpl attr = new AttributesImpl();
    attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
    attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
            JEEP_VALUE);
    attr.removeAttribute(1);
    attr.removeAttribute(1);
}