View Javadoc

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 QuoteDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
30  
31  
32        //--------------------------/
33       //- Class/Member Variables -/
34      //--------------------------/
35  
36      private java.lang.String nsPrefix;
37  
38      private java.lang.String nsURI;
39  
40      private java.lang.String xmlName;
41  
42      private org.exolab.castor.xml.XMLFieldDescriptor identity;
43  
44  
45        //----------------/
46       //- Constructors -/
47      //----------------/
48  
49      public QuoteDescriptor() {
50          super();
51          nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content";
52          xmlName = "quote";
53          XMLFieldDescriptorImpl  desc           = null;
54          XMLFieldHandler         handler        = null;
55          FieldValidator          fieldValidator = null;
56          //-- initialize attribute descriptors
57          
58          //-- initialize element descriptors
59          
60          //-- _author
61          desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_author", "author", NodeType.Element);
62          desc.setImmutable(true);
63          handler = (new XMLFieldHandler() {
64              public Object getValue( Object object ) 
65                  throws IllegalStateException
66              {
67                  Quote target = (Quote) object;
68                  return target.getAuthor();
69              }
70              public void setValue( Object object, Object value) 
71                  throws IllegalStateException, IllegalArgumentException
72              {
73                  try {
74                      Quote target = (Quote) object;
75                      target.setAuthor( (java.lang.String) value);
76                  }
77                  catch (Exception ex) {
78                      throw new IllegalStateException(ex.toString());
79                  }
80              }
81              public Object newInstance( Object parent ) {
82                  return null;
83              }
84          } );
85          desc.setHandler(handler);
86          desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
87          desc.setRequired(true);
88          desc.setMultivalued(false);
89          addFieldDescriptor(desc);
90          
91          //-- validation code for: _author
92          fieldValidator = new FieldValidator();
93          fieldValidator.setMinOccurs(1);
94          { //-- local scope
95              StringValidator sv = new StringValidator();
96              sv.setWhiteSpace("preserve");
97              fieldValidator.setValidator(sv);
98          }
99          desc.setValidator(fieldValidator);
100         
101         //-- _link
102         desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_link", "link", NodeType.Element);
103         desc.setImmutable(true);
104         handler = (new XMLFieldHandler() {
105             public Object getValue( Object object ) 
106                 throws IllegalStateException
107             {
108                 Quote target = (Quote) object;
109                 return target.getLink();
110             }
111             public void setValue( Object object, Object value) 
112                 throws IllegalStateException, IllegalArgumentException
113             {
114                 try {
115                     Quote target = (Quote) object;
116                     target.setLink( (java.lang.String) value);
117                 }
118                 catch (Exception ex) {
119                     throw new IllegalStateException(ex.toString());
120                 }
121             }
122             public Object newInstance( Object parent ) {
123                 return null;
124             }
125         } );
126         desc.setHandler(handler);
127         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
128         desc.setMultivalued(false);
129         addFieldDescriptor(desc);
130         
131         //-- validation code for: _link
132         fieldValidator = new FieldValidator();
133         { //-- local scope
134             StringValidator sv = new StringValidator();
135             sv.setWhiteSpace("preserve");
136             fieldValidator.setValidator(sv);
137         }
138         desc.setValidator(fieldValidator);
139         
140         //-- _p
141         desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_p", "p", NodeType.Element);
142         desc.setImmutable(true);
143         handler = (new XMLFieldHandler() {
144             public Object getValue( Object object ) 
145                 throws IllegalStateException
146             {
147                 Quote target = (Quote) object;
148                 return target.getP();
149             }
150             public void setValue( Object object, Object value) 
151                 throws IllegalStateException, IllegalArgumentException
152             {
153                 try {
154                     Quote target = (Quote) object;
155                     target.setP( (java.lang.String) value);
156                 }
157                 catch (Exception ex) {
158                     throw new IllegalStateException(ex.toString());
159                 }
160             }
161             public Object newInstance( Object parent ) {
162                 return null;
163             }
164         } );
165         desc.setHandler(handler);
166         desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
167         desc.setRequired(true);
168         desc.setMultivalued(false);
169         addFieldDescriptor(desc);
170         
171         //-- validation code for: _p
172         fieldValidator = new FieldValidator();
173         fieldValidator.setMinOccurs(1);
174         { //-- local scope
175             StringValidator sv = new StringValidator();
176             sv.setWhiteSpace("preserve");
177             fieldValidator.setValidator(sv);
178         }
179         desc.setValidator(fieldValidator);
180         
181     } //-- org.apache.jetspeed.xml.api.jcm.QuoteDescriptor()
182 
183 
184       //-----------/
185      //- Methods -/
186     //-----------/
187 
188     /***
189     **/
190     public org.exolab.castor.mapping.AccessMode getAccessMode()
191     {
192         return null;
193     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
194 
195     /***
196     **/
197     public org.exolab.castor.mapping.ClassDescriptor getExtends()
198     {
199         return null;
200     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
201 
202     /***
203     **/
204     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
205     {
206         return identity;
207     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
208 
209     /***
210     **/
211     public java.lang.Class getJavaClass()
212     {
213         return org.apache.jetspeed.xml.api.jcm.Quote.class;
214     } //-- java.lang.Class getJavaClass() 
215 
216     /***
217     **/
218     public java.lang.String getNameSpacePrefix()
219     {
220         return nsPrefix;
221     } //-- java.lang.String getNameSpacePrefix() 
222 
223     /***
224     **/
225     public java.lang.String getNameSpaceURI()
226     {
227         return nsURI;
228     } //-- java.lang.String getNameSpaceURI() 
229 
230     /***
231     **/
232     public org.exolab.castor.xml.TypeValidator getValidator()
233     {
234         return this;
235     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
236 
237     /***
238     **/
239     public java.lang.String getXMLName()
240     {
241         return xmlName;
242     } //-- java.lang.String getXMLName() 
243 
244 }