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 EntryDescriptor 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 EntryDescriptor() {
50          super();
51          nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content";
52          xmlName = "entry";
53          XMLFieldDescriptorImpl  desc           = null;
54          XMLFieldHandler         handler        = null;
55          FieldValidator          fieldValidator = null;
56          //-- initialize attribute descriptors
57          
58          //-- _name
59          desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", NodeType.Attribute);
60          desc.setImmutable(true);
61          handler = (new XMLFieldHandler() {
62              public Object getValue( Object object ) 
63                  throws IllegalStateException
64              {
65                  Entry target = (Entry) object;
66                  return target.getName();
67              }
68              public void setValue( Object object, Object value) 
69                  throws IllegalStateException, IllegalArgumentException
70              {
71                  try {
72                      Entry target = (Entry) object;
73                      target.setName( (java.lang.String) value);
74                  }
75                  catch (Exception ex) {
76                      throw new IllegalStateException(ex.toString());
77                  }
78              }
79              public Object newInstance( Object 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: _name
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          //-- _image
99          desc = new XMLFieldDescriptorImpl(Image.class, "_image", "image", NodeType.Element);
100         handler = (new XMLFieldHandler() {
101             public Object getValue( Object object ) 
102                 throws IllegalStateException
103             {
104                 Entry target = (Entry) object;
105                 return target.getImage();
106             }
107             public void setValue( Object object, Object value) 
108                 throws IllegalStateException, IllegalArgumentException
109             {
110                 try {
111                     Entry target = (Entry) object;
112                     target.setImage( (Image) value);
113                 }
114                 catch (Exception ex) {
115                     throw new IllegalStateException(ex.toString());
116                 }
117             }
118             public Object newInstance( Object parent ) {
119                 return new Image();
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: _image
129         fieldValidator = new FieldValidator();
130         fieldValidator.setMinOccurs(1);
131         desc.setValidator(fieldValidator);
132         
133     } //-- org.apache.jetspeed.xml.api.jcm.EntryDescriptor()
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 getJavaClass()
164     {
165         return org.apache.jetspeed.xml.api.jcm.Entry.class;
166     } //-- java.lang.Class getJavaClass() 
167 
168     /***
169     **/
170     public java.lang.String getNameSpacePrefix()
171     {
172         return nsPrefix;
173     } //-- java.lang.String getNameSpacePrefix() 
174 
175     /***
176     **/
177     public java.lang.String 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 getXMLName()
192     {
193         return xmlName;
194     } //-- java.lang.String getXMLName() 
195 
196 }