KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > MockXmlObject


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;
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
23 import javax.xml.namespace.QName JavaDoc;
24 import javax.xml.stream.XMLStreamReader;
25
26 /**
27  * A mock {@link XmlObject}, for use in tests.
28  */

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