1 16 package com.google.gwt.xml.client.impl; 17 18 import com.google.gwt.core.client.JavaScriptException; 19 import com.google.gwt.core.client.JavaScriptObject; 20 import com.google.gwt.xml.client.CharacterData; 21 import com.google.gwt.xml.client.DOMException; 22 23 26 abstract class CharacterDataImpl extends NodeImpl implements 27 CharacterData { 28 29 protected CharacterDataImpl(JavaScriptObject o) { 30 super(o); 31 } 32 33 37 public void appendData(String arg) { 38 try { 39 XMLParserImpl.appendData(this.getJsObject(), arg); 40 } catch (JavaScriptException e) { 41 throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); 42 } 43 } 44 45 49 public void deleteData(int offset, int count) { 50 try { 51 XMLParserImpl.deleteData(this.getJsObject(), offset, count); 52 } catch (JavaScriptException e) { 53 throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); 54 } 55 } 56 57 61 public String getData() { 62 return XMLParserImpl.getData(this.getJsObject()); 63 } 64 65 69 public int getLength() { 70 return XMLParserImpl.getLength(this.getJsObject()); 71 } 72 73 77 public void insertData(int offset, String arg) { 78 try { 79 XMLParserImpl.insertData(this.getJsObject(), offset, arg); 80 } catch (JavaScriptException e) { 81 throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); 82 } 83 } 84 85 89 public void replaceData(int offset, int count, String arg) { 90 try { 91 XMLParserImpl.replaceData(this.getJsObject(), offset, count, arg); 92 } catch (JavaScriptException e) { 93 throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); 94 } 95 } 96 97 101 public void setData(String data) { 102 try { 103 XMLParserImpl.setData(this.getJsObject(), data); 104 } catch (JavaScriptException e) { 105 throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); 106 } 107 } 108 109 113 public String substringData(final int offset, final int count) { 114 try { 115 return XMLParserImpl.substringData(this.getJsObject(), offset, count); 116 } catch (JavaScriptException e) { 117 throw new DOMNodeException(DOMException.INVALID_ACCESS_ERR, e, this); 118 } 119 } 120 121 public abstract String toString(); 122 } 123 | Popular Tags |