/** * @since SAAJ 1.2 * @param offset * @param count * @throws DOMException */ public void deleteData(int offset, int count) throws DOMException { textRep.deleteData(offset, count); }
/** * @since SAAJ 1.2 * @param offset * @param count * @throws DOMException */ public void deleteData(int offset, int count) throws DOMException { textRep.deleteData(offset, count); }
/** This function inserts text into a Node and invokes * a method to fix-up all other Ranges. */ void deleteData(CharacterData node, int offset, int count) { fDeleteNode = node; node.deleteData( offset, count); fDeleteNode = null; }
/** * @since SAAJ 1.2 * @param offset * @param count * @throws DOMException */ public void deleteData(int offset, int count) throws DOMException { textRep.deleteData(offset, count); }
/** This function inserts text into a Node and invokes * a method to fix-up all other Ranges. */ void deleteData(CharacterData node, int offset, int count) { fDeleteNode = node; node.deleteData( offset, count); fDeleteNode = null; }
/** This function inserts text into a Node and invokes * a method to fix-up all other Ranges. */ void deleteData(CharacterData node, int offset, int count) { fDeleteNode = node; node.deleteData( offset, count); fDeleteNode = null; }
@Override public void deleteData(int offset, int count) throws DOMException { domNode.deleteData(offset, count); }
/** * Remove a range of 16-bit units from the node. Upon success, <code>data</code> and * <code>length</code> reflect the change. * * @param offset The offset from which to start removing. * @param count The number of 16-bit units to delete. If the sum of <code>offset</code> and * <code>count</code> exceeds <code>length</code> then all 16-bit units from * <code>offset</code> to the end of the data are deleted. * @throws DOMException INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is negative * or greater than the number of 16-bit units in <code>data</code>, or if * the specified <code>count</code> is negative. <br>NO_MODIFICATION_ALLOWED_ERR: * Raised if this node is readonly. */ public void deleteData(int offset, int count) throws DOMException { target.deleteData(offset, count); }
/** * Remove a range of 16-bit units from the node. Upon success, <code>data</code> and * <code>length</code> reflect the change. * * @param offset The offset from which to start removing. * @param count The number of 16-bit units to delete. If the sum of <code>offset</code> and * <code>count</code> exceeds <code>length</code> then all 16-bit units from * <code>offset</code> to the end of the data are deleted. * @throws DOMException INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is negative * or greater than the number of 16-bit units in <code>data</code>, or if * the specified <code>count</code> is negative. <br>NO_MODIFICATION_ALLOWED_ERR: * Raised if this node is readonly. */ public void deleteData(int offset, int count) throws DOMException { target.deleteData(offset, count); }
public void deleteData(int offset, int count) throws DOMException { try { _delegate.deleteData(offset, count); } catch (org.w3c.dom.DOMException ex) { throw wrap(ex); } }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("hc_staff", true); elementList = doc.getElementsByTagName("acronym"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(0, 16); childData = child.getData(); assertEquals("data", "Dallas, Texas 98551", childData); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("staff", true); elementList = doc.getElementsByTagName("address"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(4, 50); childData = child.getData(); assertEquals("characterdataDeleteDataExceedsLengthAssert", "1230", childData); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("staff", true); elementList = doc.getElementsByTagName("address"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(16, 8); childData = child.getData(); assertEquals("characterdataDeleteDataMiddleAssert", "1230 North Ave. Texas 98551", childData); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("hc_staff", true); elementList = doc.getElementsByTagName("acronym"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(4, 50); childData = child.getData(); assertEquals("characterdataDeleteDataExceedsLengthAssert", "1230", childData); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("staff", true); elementList = doc.getElementsByTagName("address"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(30, 5); childData = child.getData(); assertEquals("characterdataDeleteDataEndAssert", "1230 North Ave. Dallas, Texas ", childData); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("hc_staff", true); elementList = doc.getElementsByTagName("acronym"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(16, 8); childData = child.getData(); assertEquals("characterdataDeleteDataMiddleAssert", "1230 North Ave. Texas 98551", childData); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("hc_staff", true); elementList = doc.getElementsByTagName("acronym"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(30, 5); childData = child.getData(); assertEquals("characterdataDeleteDataEndAssert", "1230 North Ave. Dallas, Texas ", childData); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; CharacterData child; String childData; doc = (Document) load("staff", true); elementList = doc.getElementsByTagName("address"); nameNode = elementList.item(0); child = (CharacterData) nameNode.getFirstChild(); child.deleteData(0, 16); childData = child.getData(); assertEquals("characterdataDeleteDataBeginingAssert", "Dallas, Texas 98551", childData); } /**
public org.w3c.dom.Text splitText(int offset) throws DOMException { int length = textRep.getLength(); // take the first part, and save the second part for new Text // length check and exception will be thrown here, no need to // duplicated check String tailData = textRep.substringData(offset, length); textRep.deleteData(offset, length); // insert the first part again as a new node Text tailText = new CommentImpl(tailData); org.w3c.dom.Node myParent = (org.w3c.dom.Node) getParentNode(); if (myParent != null) { org.w3c.dom.NodeList brothers = (org.w3c.dom.NodeList) myParent.getChildNodes(); for (int i = 0; i < brothers.getLength(); i++) { if (brothers.item(i).equals(this)) { myParent.insertBefore(tailText, this); return tailText; } } } return tailText; }
public org.w3c.dom.Text splitText(int offset) throws DOMException { int length = textRep.getLength(); // take the first part, and save the second part for new Text // length check and exception will be thrown here, no need to // duplicated check String tailData = textRep.substringData(offset, length); textRep.deleteData(offset, length); // insert the first part again as a new node Text tailText = new CommentImpl(tailData); org.w3c.dom.Node myParent = (org.w3c.dom.Node) getParentNode(); if (myParent != null) { org.w3c.dom.NodeList brothers = (org.w3c.dom.NodeList) myParent.getChildNodes(); for (int i = 0; i < brothers.getLength(); i++) { if (brothers.item(i).equals(this)) { myParent.insertBefore(tailText, this); return tailText; } } } return tailText; }