{@inheritDoc}
(final int offset)
| 56 | * {@inheritDoc} |
| 57 | */ |
| 58 | @Override |
| 59 | public DomText splitText(final int offset) { |
| 60 | if (offset < 0 || offset > getLength()) { |
| 61 | throw new IllegalArgumentException("offset: " + offset + " data.length: " + getLength()); |
| 62 | } |
| 63 | |
| 64 | // split text into two separate nodes |
| 65 | final DomText newText = createSplitTextNode(offset); |
| 66 | setData(getData().substring(0, offset)); |
| 67 | |
| 68 | // insert new text node |
| 69 | if (getParentNode() != null) { |
| 70 | getParentNode().insertBefore(newText, getNextSibling()); |
| 71 | } |
| 72 | return newText; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Creates a new text node split from another text node. This method allows |