KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > xml > api > jcm > ItemDescriptor


1 /*
2  * This class was automatically generated with
3  * <a HREF="http://castor.exolab.org">Castor 0.9.2</a>, using an
4  * XML Schema.
5  * $Id$
6  */

7
8 package org.apache.jetspeed.xml.api.jcm;
9
10   //---------------------------------/
11
//- Imported classes and packages -/
12
//---------------------------------/
13

14 import org.exolab.castor.mapping.AccessMode;
15 import org.exolab.castor.mapping.ClassDescriptor;
16 import org.exolab.castor.mapping.FieldDescriptor;
17 import org.exolab.castor.xml.*;
18 import org.exolab.castor.xml.FieldValidator;
19 import org.exolab.castor.xml.TypeValidator;
20 import org.exolab.castor.xml.XMLFieldDescriptor;
21 import org.exolab.castor.xml.handlers.*;
22 import org.exolab.castor.xml.util.XMLFieldDescriptorImpl;
23 import org.exolab.castor.xml.validators.*;
24
25 /**
26  *
27  * @version $Revision$ $Date$
28 **/

29 public class ItemDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
30
31
32       //--------------------------/
33
//- Class/Member Variables -/
34
//--------------------------/
35

36     private java.lang.String JavaDoc nsPrefix;
37
38     private java.lang.String JavaDoc nsURI;
39
40     private java.lang.String JavaDoc xmlName;
41
42     private org.exolab.castor.xml.XMLFieldDescriptor identity;
43
44
45       //----------------/
46
//- Constructors -/
47
//----------------/
48

49     public ItemDescriptor() {
50         super();
51         nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content";
52         xmlName = "item";
53         XMLFieldDescriptorImpl desc = null;
54         XMLFieldHandler handler = null;
55         FieldValidator fieldValidator = null;
56         //-- initialize attribute descriptors
57

58         //-- initialize element descriptors
59

60         //-- _topic
61
desc = new XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_topic", "topic", NodeType.Element);
62         desc.setImmutable(true);
63         handler = (new XMLFieldHandler() {
64             public Object JavaDoc getValue( Object JavaDoc object )
65                 throws IllegalStateException JavaDoc
66             {
67                 Item target = (Item) object;
68                 return target.getTopic();
69             }
70             public void setValue( Object JavaDoc object, Object JavaDoc value)
71                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
72             {
73                 try {
74                     Item target = (Item) object;
75                     target.setTopic( (java.lang.String JavaDoc) value);
76                 }
77                 catch (Exception JavaDoc ex) {
78                     throw new IllegalStateException JavaDoc(ex.toString());
79                 }
80             }
81             public Object JavaDoc newInstance( Object JavaDoc parent ) {
82                 return null;
83             }
84         } );
85         desc.setHandler(handler);
86         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
87         desc.setMultivalued(false);
88         addFieldDescriptor(desc);
89         
90         //-- validation code for: _topic
91
fieldValidator = new FieldValidator();
92         { //-- local scope
93
StringValidator sv = new StringValidator();
94             sv.setWhiteSpace("preserve");
95             fieldValidator.setValidator(sv);
96         }
97         desc.setValidator(fieldValidator);
98         
99         //-- _pubDate
100
desc = new XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_pubDate", "pubDate", NodeType.Element);
101         desc.setImmutable(true);
102         handler = (new XMLFieldHandler() {
103             public Object JavaDoc getValue( Object JavaDoc object )
104                 throws IllegalStateException JavaDoc
105             {
106                 Item target = (Item) object;
107                 return target.getPubDate();
108             }
109             public void setValue( Object JavaDoc object, Object JavaDoc value)
110                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
111             {
112                 try {
113                     Item target = (Item) object;
114                     target.setPubDate( (java.lang.String JavaDoc) value);
115                 }
116                 catch (Exception JavaDoc ex) {
117                     throw new IllegalStateException JavaDoc(ex.toString());
118                 }
119             }
120             public Object JavaDoc newInstance( Object JavaDoc parent ) {
121                 return null;
122             }
123         } );
124         desc.setHandler(handler);
125         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
126         desc.setMultivalued(false);
127         addFieldDescriptor(desc);
128         
129         //-- validation code for: _pubDate
130
fieldValidator = new FieldValidator();
131         { //-- local scope
132
StringValidator sv = new StringValidator();
133             sv.setWhiteSpace("preserve");
134             fieldValidator.setValidator(sv);
135         }
136         desc.setValidator(fieldValidator);
137         
138         //-- _title
139
desc = new XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_title", "title", NodeType.Element);
140         desc.setImmutable(true);
141         handler = (new XMLFieldHandler() {
142             public Object JavaDoc getValue( Object JavaDoc object )
143                 throws IllegalStateException JavaDoc
144             {
145                 Item target = (Item) object;
146                 return target.getTitle();
147             }
148             public void setValue( Object JavaDoc object, Object JavaDoc value)
149                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
150             {
151                 try {
152                     Item target = (Item) object;
153                     target.setTitle( (java.lang.String JavaDoc) value);
154                 }
155                 catch (Exception JavaDoc ex) {
156                     throw new IllegalStateException JavaDoc(ex.toString());
157                 }
158             }
159             public Object JavaDoc newInstance( Object JavaDoc parent ) {
160                 return null;
161             }
162         } );
163         desc.setHandler(handler);
164         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
165         desc.setMultivalued(false);
166         addFieldDescriptor(desc);
167         
168         //-- validation code for: _title
169
fieldValidator = new FieldValidator();
170         { //-- local scope
171
StringValidator sv = new StringValidator();
172             sv.setWhiteSpace("preserve");
173             fieldValidator.setValidator(sv);
174         }
175         desc.setValidator(fieldValidator);
176         
177         //-- _link
178
desc = new XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_link", "link", NodeType.Element);
179         desc.setImmutable(true);
180         handler = (new XMLFieldHandler() {
181             public Object JavaDoc getValue( Object JavaDoc object )
182                 throws IllegalStateException JavaDoc
183             {
184                 Item target = (Item) object;
185                 return target.getLink();
186             }
187             public void setValue( Object JavaDoc object, Object JavaDoc value)
188                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
189             {
190                 try {
191                     Item target = (Item) object;
192                     target.setLink( (java.lang.String JavaDoc) value);
193                 }
194                 catch (Exception JavaDoc ex) {
195                     throw new IllegalStateException JavaDoc(ex.toString());
196                 }
197             }
198             public Object JavaDoc newInstance( Object JavaDoc parent ) {
199                 return null;
200             }
201         } );
202         desc.setHandler(handler);
203         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
204         desc.setMultivalued(false);
205         addFieldDescriptor(desc);
206         
207         //-- validation code for: _link
208
fieldValidator = new FieldValidator();
209         { //-- local scope
210
StringValidator sv = new StringValidator();
211             sv.setWhiteSpace("preserve");
212             fieldValidator.setValidator(sv);
213         }
214         desc.setValidator(fieldValidator);
215         
216         //-- _description
217
desc = new XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_description", "description", NodeType.Element);
218         desc.setImmutable(true);
219         handler = (new XMLFieldHandler() {
220             public Object JavaDoc getValue( Object JavaDoc object )
221                 throws IllegalStateException JavaDoc
222             {
223                 Item target = (Item) object;
224                 return target.getDescription();
225             }
226             public void setValue( Object JavaDoc object, Object JavaDoc value)
227                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
228             {
229                 try {
230                     Item target = (Item) object;
231                     target.setDescription( (java.lang.String JavaDoc) value);
232                 }
233                 catch (Exception JavaDoc ex) {
234                     throw new IllegalStateException JavaDoc(ex.toString());
235                 }
236             }
237             public Object JavaDoc newInstance( Object JavaDoc parent ) {
238                 return null;
239             }
240         } );
241         desc.setHandler(handler);
242         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
243         desc.setMultivalued(false);
244         addFieldDescriptor(desc);
245         
246         //-- validation code for: _description
247
fieldValidator = new FieldValidator();
248         { //-- local scope
249
StringValidator sv = new StringValidator();
250             sv.setWhiteSpace("preserve");
251             fieldValidator.setValidator(sv);
252         }
253         desc.setValidator(fieldValidator);
254         
255         //-- _quote
256
desc = new XMLFieldDescriptorImpl(Quote.class, "_quote", "quote", NodeType.Element);
257         handler = (new XMLFieldHandler() {
258             public Object JavaDoc getValue( Object JavaDoc object )
259                 throws IllegalStateException JavaDoc
260             {
261                 Item target = (Item) object;
262                 return target.getQuote();
263             }
264             public void setValue( Object JavaDoc object, Object JavaDoc value)
265                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
266             {
267                 try {
268                     Item target = (Item) object;
269                     target.setQuote( (Quote) value);
270                 }
271                 catch (Exception JavaDoc ex) {
272                     throw new IllegalStateException JavaDoc(ex.toString());
273                 }
274             }
275             public Object JavaDoc newInstance( Object JavaDoc parent ) {
276                 return new Quote();
277             }
278         } );
279         desc.setHandler(handler);
280         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
281         desc.setMultivalued(false);
282         addFieldDescriptor(desc);
283         
284         //-- validation code for: _quote
285
fieldValidator = new FieldValidator();
286         desc.setValidator(fieldValidator);
287         
288     } //-- org.apache.jetspeed.xml.api.jcm.ItemDescriptor()
289

290
291       //-----------/
292
//- Methods -/
293
//-----------/
294

295     /**
296     **/

297     public org.exolab.castor.mapping.AccessMode getAccessMode()
298     {
299         return null;
300     } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
301

302     /**
303     **/

304     public org.exolab.castor.mapping.ClassDescriptor getExtends()
305     {
306         return null;
307     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
308

309     /**
310     **/

311     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
312     {
313         return identity;
314     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
315

316     /**
317     **/

318     public java.lang.Class JavaDoc getJavaClass()
319     {
320         return org.apache.jetspeed.xml.api.jcm.Item.class;
321     } //-- java.lang.Class getJavaClass()
322

323     /**
324     **/

325     public java.lang.String JavaDoc getNameSpacePrefix()
326     {
327         return nsPrefix;
328     } //-- java.lang.String getNameSpacePrefix()
329

330     /**
331     **/

332     public java.lang.String JavaDoc getNameSpaceURI()
333     {
334         return nsURI;
335     } //-- java.lang.String getNameSpaceURI()
336

337     /**
338     **/

339     public org.exolab.castor.xml.TypeValidator getValidator()
340     {
341         return this;
342     } //-- org.exolab.castor.xml.TypeValidator getValidator()
343

344     /**
345     **/

346     public java.lang.String JavaDoc getXMLName()
347     {
348         return xmlName;
349     } //-- java.lang.String getXMLName()
350

351 }
352
Popular Tags