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 TopicsDescriptor 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 TopicsDescriptor() {
50          super();
51          nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content";
52          xmlName = "topics";
53          XMLFieldDescriptorImpl  desc           = null;
54          XMLFieldHandler         handler        = null;
55          FieldValidator          fieldValidator = null;
56          //-- initialize attribute descriptors
57          
58          //-- initialize element descriptors
59          
60          //-- _entryList
61          desc = new XMLFieldDescriptorImpl(Entry.class, "_entryList", "entry", NodeType.Element);
62          handler = (new XMLFieldHandler() {
63              public Object getValue( Object object ) 
64                  throws IllegalStateException
65              {
66                  Topics target = (Topics) object;
67                  return target.getEntry();
68              }
69              public void setValue( Object object, Object value) 
70                  throws IllegalStateException, IllegalArgumentException
71              {
72                  try {
73                      Topics target = (Topics) object;
74                      target.addEntry( (Entry) value);
75                  }
76                  catch (Exception ex) {
77                      throw new IllegalStateException(ex.toString());
78                  }
79              }
80              public Object newInstance( Object parent ) {
81                  return new Entry();
82              }
83          } );
84          desc.setHandler(handler);
85          desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
86          desc.setRequired(true);
87          desc.setMultivalued(true);
88          addFieldDescriptor(desc);
89          
90          //-- validation code for: _entryList
91          fieldValidator = new FieldValidator();
92          fieldValidator.setMinOccurs(1);
93          desc.setValidator(fieldValidator);
94          
95      } //-- org.apache.jetspeed.xml.api.jcm.TopicsDescriptor()
96  
97  
98        //-----------/
99       //- Methods -/
100     //-----------/
101 
102     /***
103     **/
104     public org.exolab.castor.mapping.AccessMode getAccessMode()
105     {
106         return null;
107     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
108 
109     /***
110     **/
111     public org.exolab.castor.mapping.ClassDescriptor getExtends()
112     {
113         return null;
114     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
115 
116     /***
117     **/
118     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
119     {
120         return identity;
121     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
122 
123     /***
124     **/
125     public java.lang.Class getJavaClass()
126     {
127         return org.apache.jetspeed.xml.api.jcm.Topics.class;
128     } //-- java.lang.Class getJavaClass() 
129 
130     /***
131     **/
132     public java.lang.String getNameSpacePrefix()
133     {
134         return nsPrefix;
135     } //-- java.lang.String getNameSpacePrefix() 
136 
137     /***
138     **/
139     public java.lang.String getNameSpaceURI()
140     {
141         return nsURI;
142     } //-- java.lang.String getNameSpaceURI() 
143 
144     /***
145     **/
146     public org.exolab.castor.xml.TypeValidator getValidator()
147     {
148         return this;
149     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
150 
151     /***
152     **/
153     public java.lang.String getXMLName()
154     {
155         return xmlName;
156     } //-- java.lang.String getXMLName() 
157 
158 }