Code example for DOMException

0
 
    public void insertData(int offset, String arg) throws DOMException {
        try { 
            buffer.insert(offset, arg);
        } catch (ArrayIndexOutOfBoundsException ex) {
            throw new DOMException(DOMException.INDEX_SIZE_ERR, null);
        } 
    } 
 
    public void replaceData(int offset, int count, String arg)
            throws DOMException { 
        try { 
            buffer.replace(offset, offset + count, arg);
        } catch (ArrayIndexOutOfBoundsException ex) {
            throw new DOMException(DOMException.INDEX_SIZE_ERR, null);
        } 
    } 
 
    public void setData(String data) throws DOMException {
        buffer = new StringBuffer(data);
Contextual code suggestions in your IDE  Get Codota for Java