/** * Remove a range of characters from the node's value. Throws a * DOMException if the offset is beyond the end of the * string. However, a deletion _count_ that exceeds the available * data is accepted as a delete-to-end request. * * @throws DOMException(INDEX_SIZE_ERR) if offset is negative or * greater than length, or if count is negative. * * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is * readonly. */ public void deleteData(int offset, int count) throws DOMException { internalDeleteData(offset, count, false); } // deleteData(int,int)
/** * Insert additional characters into the data stored in this node, * at the offset specified. * * @throws DOMException(INDEX_SIZE_ERR) if offset is negative or * greater than length. * * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is readonly. */ public void insertData(int offset, String data) throws DOMException { internalInsertData(offset, data, false); } // insertData(int,int)
public String getNodeValue() { if (needsSyncData()) { synchronizeData(); } return data; }
/** * Sets the content, possibly firing related events, * and updating ranges (via notification to the document) */ public void setNodeValue(String value) { setNodeValueInternal(value); // notify document ownerDocument().replacedText(this); }
CoreDocumentImpl ownerDocument = ownerDocument(); if (ownerDocument.errorChecking && isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); if (needsSyncData()) { synchronizeData();
throws DOMException { CoreDocumentImpl ownerDocument = ownerDocument(); if (ownerDocument.errorChecking && isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); if (needsSyncData()) { synchronizeData(); internalDeleteData(offset, count, true); internalInsertData(offset, data, true);
/** * Concatenate additional characters onto the end of the data * stored in this node. Note that this, and insert(), are the paths * by which a DOM could wind up accumulating more data than the * language's strings can easily handle. (See above discussion.) * * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is readonly. */ public void appendData(String data) { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } if (data == null) { return; } if (needsSyncData()) { synchronizeData(); } setNodeValue(this.data + data); } // appendData(String)
/** Convenience wrapper for calling setNodeValueInternal when * we are not performing a replacement operation */ protected void setNodeValueInternal (String value) { setNodeValueInternal(value, false); }
/** * Store character data into this node. * * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is readonly. */ public void setData(String value) throws DOMException { setNodeValue(value); }
((CharacterDataImpl)fStartContainer).deleteData(fStartOffset, fEndOffset-fStartOffset);
throws DOMException { CoreDocumentImpl ownerDocument = ownerDocument(); if (ownerDocument.errorChecking && isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); if (needsSyncData()) { synchronizeData(); setNodeValueInternal(value, replace);
throws DOMException { CoreDocumentImpl ownerDocument = ownerDocument(); if (ownerDocument.errorChecking) { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); if (needsSyncData()) { synchronizeData(); (tailLength > 0 ? data.substring(offset + count, offset + count + tailLength) : ""); setNodeValueInternal(value, replace);
/** * Retrieve character data currently stored in this node. * * @throws DOMExcpetion(DOMSTRING_SIZE_ERR) In some implementations, * the stored data may exceed the permitted length of strings. If so, * getData() will throw this DOMException advising the user to * instead retrieve the data in chunks via the substring() operation. */ public String getData() { if (needsSyncData()) { synchronizeData(); } return data; }
/** * Report number of characters currently stored in this node's * data. It may be 0, meaning that the value is an empty string. */ public int getLength() { if (needsSyncData()) { synchronizeData(); } return data.length(); }
throws DOMException { if (needsSyncData()) { synchronizeData();