KickJava   Java API By Example, From Geeks To Geeks.

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


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 ContentDescriptor 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 ContentDescriptor() {
50         super();
51         nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content";
52         xmlName = "content";
53         XMLFieldDescriptorImpl desc = null;
54         XMLFieldHandler handler = null;
55         FieldValidator fieldValidator = null;
56         //-- initialize attribute descriptors
57

58         //-- _version
59
desc = new XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_version", "version", NodeType.Attribute);
60         desc.setImmutable(true);
61         handler = (new XMLFieldHandler() {
62             public Object JavaDoc getValue( Object JavaDoc object )
63                 throws IllegalStateException JavaDoc
64             {
65                 Content target = (Content) object;
66                 return target.getVersion();
67             }
68             public void setValue( Object JavaDoc object, Object JavaDoc value)
69                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
70             {
71                 try {
72                     Content target = (Content) object;
73                     target.setVersion( (java.lang.String JavaDoc) value);
74                 }
75                 catch (Exception JavaDoc ex) {
76                     throw new IllegalStateException JavaDoc(ex.toString());
77                 }
78             }
79             public Object JavaDoc newInstance( Object JavaDoc parent ) {
80                 return null;
81             }
82         } );
83         desc.setHandler(handler);
84         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
85         addFieldDescriptor(desc);
86         
87         //-- validation code for: _version
88
fieldValidator = new FieldValidator();
89         { //-- local scope
90
StringValidator sv = new StringValidator();
91             sv.setWhiteSpace("preserve");
92             fieldValidator.setValidator(sv);
93         }
94         desc.setValidator(fieldValidator);
95         
96         //-- initialize element descriptors
97

98         //-- _channel
99
desc = new XMLFieldDescriptorImpl(Channel.class, "_channel", "channel", NodeType.Element);
100         handler = (new XMLFieldHandler() {
101             public Object JavaDoc getValue( Object JavaDoc object )
102                 throws IllegalStateException JavaDoc
103             {
104                 Content target = (Content) object;
105                 return target.getChannel();
106             }
107             public void setValue( Object JavaDoc object, Object JavaDoc value)
108                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
109             {
110                 try {
111                     Content target = (Content) object;
112                     target.setChannel( (Channel) value);
113                 }
114                 catch (Exception JavaDoc ex) {
115                     throw new IllegalStateException JavaDoc(ex.toString());
116                 }
117             }
118             public Object JavaDoc newInstance( Object JavaDoc parent ) {
119                 return new Channel();
120             }
121         } );
122         desc.setHandler(handler);
123         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
124         desc.setRequired(true);
125         desc.setMultivalued(false);
126         addFieldDescriptor(desc);
127         
128         //-- validation code for: _channel
129
fieldValidator = new FieldValidator();
130         fieldValidator.setMinOccurs(1);
131         desc.setValidator(fieldValidator);
132         
133     } //-- org.apache.jetspeed.xml.api.jcm.ContentDescriptor()
134

135
136       //-----------/
137
//- Methods -/
138
//-----------/
139

140     /**
141     **/

142     public org.exolab.castor.mapping.AccessMode getAccessMode()
143     {
144         return null;
145     } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
146

147     /**
148     **/

149     public org.exolab.castor.mapping.ClassDescriptor getExtends()
150     {
151         return null;
152     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
153

154     /**
155     **/

156     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
157     {
158         return identity;
159     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
160

161     /**
162     **/

163     public java.lang.Class JavaDoc getJavaClass()
164     {
165         return org.apache.jetspeed.xml.api.jcm.Content.class;
166     } //-- java.lang.Class getJavaClass()
167

168     /**
169     **/

170     public java.lang.String JavaDoc getNameSpacePrefix()
171     {
172         return nsPrefix;
173     } //-- java.lang.String getNameSpacePrefix()
174

175     /**
176     **/

177     public java.lang.String JavaDoc getNameSpaceURI()
178     {
179         return nsURI;
180     } //-- java.lang.String getNameSpaceURI()
181

182     /**
183     **/

184     public org.exolab.castor.xml.TypeValidator getValidator()
185     {
186         return this;
187     } //-- org.exolab.castor.xml.TypeValidator getValidator()
188

189     /**
190     **/

191     public java.lang.String JavaDoc getXMLName()
192     {
193         return xmlName;
194     } //-- java.lang.String getXMLName()
195

196 }
197
Popular Tags