/** * Factory method; creates a Text node having this Document as its * OwnerDoc. * * @param data The initial contents of the Text. */ public Text createTextNode(String data) { return new TextImpl(this, data); }
/** * internal method taking a StringBuffer in parameter and inserts the * text content at the start of the buffer * * @param buf */ protected void insertTextContent(StringBuffer buf) throws DOMException { String content = getNodeValue(); if (content != null) { buf.insert(0, content); } }
if (needsSyncData()) { synchronizeData(); getWholeTextBackward(this.getPreviousSibling(), buffer, this.getParentNode()); String temp = buffer.toString(); getWholeTextForward(this.getNextSibling(), buffer, this.getParentNode());
if (needsSyncData()) { synchronizeData(); Node parent = this.getParentNode(); if (content == null || content.length() == 0) { if (ownerDocument().errorChecking) { if (!canModifyPrev(this)) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage( if (!canModifyNext(this)) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage( if (isReadOnly()) { Text newNode = this.ownerDocument().createTextNode(content); if (parent != null) { // check if node in the tree parent.insertBefore(newNode, this); this.setData(content); currentNode = this; || (prev.getNodeType() == Node.ENTITY_REFERENCE_NODE && hasTextOnlyChildren(prev))) { parent.removeChild(prev); prev = currentNode; || (next.getNodeType() == Node.ENTITY_REFERENCE_NODE && hasTextOnlyChildren(next))) { parent.removeChild(next);
throws DOMException { if (isReadOnly()) { throw new DOMException( DOMException.NO_MODIFICATION_ALLOWED_ERR, if (needsSyncData()) { synchronizeData(); getOwnerDocument().createTextNode(data.substring(offset)); setNodeValue(data.substring(0, offset)); Node parentNode = getParentNode(); if (parentNode != null) { parentNode.insertBefore(newText, nextSibling);
short type = node.getNodeType(); if (type == Node.ENTITY_REFERENCE_NODE) { if (getWholeTextBackward(node.getLastChild(), buffer, node)){ return true; ((TextImpl)node).insertTextContent(buffer); getWholeTextBackward(parent.getPreviousSibling(), buffer, parent.getParentNode()); return true;
textFirstChild = true; } else if (lType == Node.ENTITY_REFERENCE_NODE) { if (!canModifyNext(firstChild)) { return false; } else {
textLastChild = true; } else if (lType == Node.ENTITY_REFERENCE_NODE) { if (!canModifyPrev(lastChild)) { return false; } else {
public void ignorableWhitespace( char[] text, int start, int length ) throws SAXException { Node node; if ( ! _ignoreWhitespace ) _current.appendChild( new TextImpl( _document, new String( text, start, length ) ) ); }
if( node instanceof TextImpl ) String val = ((TextImpl) node).getNodeValue(); if( (val != null) && (val.length() > 0) )
public void characters( char[] text, int start, int length ) throws SAXException { if ( _current == null ) throw new SAXException( "HTM010 State error: character data found outside of root element." ); _current.appendChild( new TextImpl( _document, new String( text, start, length ) ) ); }
public MathML text(String data) { CoreDocumentImpl document = (CoreDocumentImpl) document(); return new MathML(new TextImpl(document, data)); }