KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > setup > TestXmlObject


1 /**
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.config.schema.setup;
5
6 import org.apache.xmlbeans.QNameSet;
7 import org.apache.xmlbeans.SchemaType;
8 import org.apache.xmlbeans.XmlCursor;
9 import org.apache.xmlbeans.XmlDocumentProperties;
10 import org.apache.xmlbeans.XmlObject;
11 import org.apache.xmlbeans.XmlOptions;
12 import org.apache.xmlbeans.xml.stream.XMLInputStream;
13 import org.w3c.dom.Node JavaDoc;
14 import org.xml.sax.ContentHandler JavaDoc;
15 import org.xml.sax.ext.LexicalHandler JavaDoc;
16
17 import java.io.File JavaDoc;
18 import java.io.InputStream JavaDoc;
19 import java.io.OutputStream JavaDoc;
20 import java.io.Reader JavaDoc;
21 import java.io.Writer JavaDoc;
22 import java.math.BigInteger JavaDoc;
23 import java.util.HashMap JavaDoc;
24 import java.util.Map JavaDoc;
25
26 import javax.xml.namespace.QName JavaDoc;
27 import javax.xml.stream.XMLStreamReader;
28
29 /**
30  * An {@link XmlObject} used to represent beans in tests.
31  */

32 public class TestXmlObject implements XmlObject {
33
34   private final Object JavaDoc value;
35   private final Map JavaDoc childValues;
36
37   public TestXmlObject(Object JavaDoc value) {
38     this.value = value;
39     this.childValues = new HashMap JavaDoc();
40   }
41
42   public TestXmlObject() {
43     this(null);
44   }
45
46   public String JavaDoc getStringValue() {
47     return (String JavaDoc) value;
48   }
49
50   public BigInteger JavaDoc getBigIntegerValue() {
51     return new BigInteger JavaDoc(((Integer JavaDoc) value).toString());
52   }
53   
54   public boolean getBooleanValue() {
55     return ((Boolean JavaDoc) value).booleanValue();
56   }
57   
58   public String JavaDoc[] getTheStringArray() {
59     return (String JavaDoc[]) value;
60   }
61
62   public void setChildBean(String JavaDoc xpath, XmlObject[] values) {
63     this.childValues.put(xpath, values);
64   }
65
66   public void setChildBean(String JavaDoc xpath, XmlObject value) {
67     setChildBean(xpath, new XmlObject[] { value });
68   }
69
70   public SchemaType schemaType() {
71     return null;
72   }
73
74   public boolean validate() {
75     return true;
76   }
77
78   public boolean validate(XmlOptions arg0) {
79     return true;
80   }
81
82   public XmlObject[] selectPath(String JavaDoc arg0) {
83     return (XmlObject[]) this.childValues.get(arg0);
84   }
85
86   public XmlObject[] selectPath(String JavaDoc arg0, XmlOptions arg1) {
87     return (XmlObject[]) this.childValues.get(arg0);
88   }
89
90   public XmlObject[] execQuery(String JavaDoc arg0) {
91     return null;
92   }
93
94   public XmlObject[] execQuery(String JavaDoc arg0, XmlOptions arg1) {
95     return null;
96   }
97
98   public XmlObject changeType(SchemaType arg0) {
99     return null;
100   }
101
102   public XmlObject substitute(QName JavaDoc arg0, SchemaType arg1) {
103     return null;
104   }
105
106   public boolean isNil() {
107     return false;
108   }
109
110   public void setNil() { /* nothing here */
111   }
112
113   public boolean isImmutable() {
114     return false;
115   }
116
117   public XmlObject set(XmlObject arg0) {
118     return null;
119   }
120
121   public XmlObject copy() {
122     return null;
123   }
124
125   public boolean valueEquals(XmlObject arg0) {
126     return false;
127   }
128
129   public int valueHashCode() {
130     return 0;
131   }
132
133   public int compareTo(Object JavaDoc arg0) {
134     return 0;
135   }
136
137   public int compareValue(XmlObject arg0) {
138     return 0;
139   }
140
141   public XmlObject[] selectChildren(QName JavaDoc arg0) {
142     return null;
143   }
144
145   public XmlObject[] selectChildren(String JavaDoc arg0, String JavaDoc arg1) {
146     return null;
147   }
148
149   public XmlObject[] selectChildren(QNameSet arg0) {
150     return null;
151   }
152
153   public XmlObject selectAttribute(QName JavaDoc arg0) {
154     return null;
155   }
156
157   public XmlObject selectAttribute(String JavaDoc arg0, String JavaDoc arg1) {
158     return null;
159   }
160
161   public XmlObject[] selectAttributes(QNameSet arg0) {
162     return null;
163   }
164
165   public Object JavaDoc monitor() {
166     return null;
167   }
168
169   public XmlDocumentProperties documentProperties() {
170     return null;
171   }
172
173   public XmlCursor newCursor() {
174     return null;
175   }
176
177   public XMLInputStream newXMLInputStream() {
178     return null;
179   }
180
181   public XMLStreamReader newXMLStreamReader() {
182     return null;
183   }
184
185   public String JavaDoc xmlText() {
186     return null;
187   }
188
189   public InputStream newInputStream() {
190     return null;
191   }
192
193   public Reader JavaDoc newReader() {
194     return null;
195   }
196
197   public Node JavaDoc newDomNode() {
198     return null;
199   }
200
201   public Node JavaDoc getDomNode() {
202     return null;
203   }
204
205   public void save(ContentHandler JavaDoc arg0, LexicalHandler JavaDoc arg1) { /* nothing here */
206   }
207
208   public void save(File JavaDoc arg0) { /* nothing here */
209   }
210
211   public void save(OutputStream JavaDoc arg0) { /* nothing here */
212   }
213
214   public void save(Writer JavaDoc arg0) { /* nothing here */
215   }
216
217   public XMLInputStream newXMLInputStream(XmlOptions arg0) {
218     return null;
219   }
220
221   public XMLStreamReader newXMLStreamReader(XmlOptions arg0) {
222     return null;
223   }
224
225   public String JavaDoc xmlText(XmlOptions arg0) {
226     return null;
227   }
228
229   public InputStream newInputStream(XmlOptions arg0) {
230     return null;
231   }
232
233   public Reader JavaDoc newReader(XmlOptions arg0) {
234     return null;
235   }
236
237   public Node JavaDoc newDomNode(XmlOptions arg0) {
238     return null;
239   }
240
241   public void save(ContentHandler JavaDoc arg0, LexicalHandler JavaDoc arg1, XmlOptions arg2) { /* nothing here */
242   }
243
244   public void save(File JavaDoc arg0, XmlOptions arg1) { /* nothing here */
245   }
246
247   public void save(OutputStream JavaDoc arg0, XmlOptions arg1) { /* nothing here */
248   }
249
250   public void save(Writer JavaDoc arg0, XmlOptions arg1) { /* nothing here */
251   }
252
253   public void dump() { /* nothing here */
254   }
255
256 }
257
Popular Tags