KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > xml > client > impl > CharacterDataImpl


1 /*
2  * Copyright 2006 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

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 /**
24  * This class implements the CharacterData interface.
25  */

26 abstract class CharacterDataImpl extends NodeImpl implements
27     CharacterData {
28
29   protected CharacterDataImpl(JavaScriptObject o) {
30     super(o);
31   }
32
33   /**
34    * This function delegates to the native method <code>appendData</code> in
35    * XMLParserImpl.
36    */

37   public void appendData(String JavaDoc 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   /**
46    * This function delegates to the native method <code>deleteData</code> in
47    * XMLParserImpl.
48    */

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   /**
58    * This function delegates to the native method <code>getData</code> in
59    * XMLParserImpl.
60    */

61   public String JavaDoc getData() {
62     return XMLParserImpl.getData(this.getJsObject());
63   }
64
65   /**
66    * This function delegates to the native method <code>getLength</code> in
67    * XMLParserImpl.
68    */

69   public int getLength() {
70     return XMLParserImpl.getLength(this.getJsObject());
71   }
72
73   /**
74    * This function delegates to the native method <code>insertData</code> in
75    * XMLParserImpl.
76    */

77   public void insertData(int offset, String JavaDoc 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   /**
86    * This function delegates to the native method <code>replaceData</code> in
87    * XMLParserImpl.
88    */

89   public void replaceData(int offset, int count, String JavaDoc 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   /**
98    * This function delegates to the native method <code>setData</code> in
99    * XMLParserImpl.
100    */

101   public void setData(String JavaDoc 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   /**
110    * This function delegates to the native method <code>substringData</code>
111    * in XMLParserImpl.
112    */

113   public String JavaDoc 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 JavaDoc toString();
122 }
123
Popular Tags