View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.tests.framework.testDescriptor.descriptors;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.exolab.castor.tests.framework.testDescriptor.ListenerType;
15  
16  /**
17   * Class ListenerTypeDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class ListenerTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
22  
23  
24        //--------------------------/
25       //- Class/Member Variables -/
26      //--------------------------/
27  
28      /**
29       * Field _elementDefinition.
30       */
31      private boolean _elementDefinition;
32  
33      /**
34       * Field _nsPrefix.
35       */
36      private java.lang.String _nsPrefix;
37  
38      /**
39       * Field _nsURI.
40       */
41      private java.lang.String _nsURI;
42  
43      /**
44       * Field _xmlName.
45       */
46      private java.lang.String _xmlName;
47  
48      /**
49       * Field _identity.
50       */
51      private org.exolab.castor.xml.XMLFieldDescriptor _identity;
52  
53  
54        //----------------/
55       //- Constructors -/
56      //----------------/
57  
58      public ListenerTypeDescriptor() {
59          super();
60          _nsURI = "http://castor.exolab.org/Test";
61          _xmlName = "ListenerType";
62          _elementDefinition = false;
63  
64          //-- set grouping compositor
65          setCompositorAsSequence();
66          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
67          org.exolab.castor.mapping.FieldHandler             handler        = null;
68          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
69          //-- initialize attribute descriptors
70  
71          //-- initialize element descriptors
72  
73          //-- _goldFile
74          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_goldFile", "GoldFile", org.exolab.castor.xml.NodeType.Element);
75          desc.setImmutable(true);
76          handler = new org.exolab.castor.xml.XMLFieldHandler() {
77              public java.lang.Object getValue( java.lang.Object object ) 
78                  throws IllegalStateException
79              {
80                  ListenerType target = (ListenerType) object;
81                  return target.getGoldFile();
82              }
83              public void setValue( java.lang.Object object, java.lang.Object value) 
84                  throws IllegalStateException, IllegalArgumentException
85              {
86                  try {
87                      ListenerType target = (ListenerType) object;
88                      target.setGoldFile( (java.lang.String) value);
89                  } catch (java.lang.Exception ex) {
90                      throw new IllegalStateException(ex.toString());
91                  }
92              }
93              public java.lang.Object newInstance(java.lang.Object parent) {
94                  return null;
95              }
96          };
97          desc.setSchemaType("string");
98          desc.setHandler(handler);
99          desc.setNameSpaceURI("http://castor.exolab.org/Test");
100         desc.setRequired(true);
101         desc.setMultivalued(false);
102         addFieldDescriptor(desc);
103         addSequenceElement(desc);
104 
105         //-- validation code for: _goldFile
106         fieldValidator = new org.exolab.castor.xml.FieldValidator();
107         fieldValidator.setMinOccurs(1);
108         { //-- local scope
109             org.exolab.castor.xml.validators.StringValidator typeValidator;
110             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
111             fieldValidator.setValidator(typeValidator);
112             typeValidator.setWhiteSpace("preserve");
113         }
114         desc.setValidator(fieldValidator);
115         //-- _className
116         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_className", "ClassName", org.exolab.castor.xml.NodeType.Element);
117         desc.setImmutable(true);
118         handler = new org.exolab.castor.xml.XMLFieldHandler() {
119             public java.lang.Object getValue( java.lang.Object object ) 
120                 throws IllegalStateException
121             {
122                 ListenerType target = (ListenerType) object;
123                 return target.getClassName();
124             }
125             public void setValue( java.lang.Object object, java.lang.Object value) 
126                 throws IllegalStateException, IllegalArgumentException
127             {
128                 try {
129                     ListenerType target = (ListenerType) object;
130                     target.setClassName( (java.lang.String) value);
131                 } catch (java.lang.Exception ex) {
132                     throw new IllegalStateException(ex.toString());
133                 }
134             }
135             public java.lang.Object newInstance(java.lang.Object parent) {
136                 return null;
137             }
138         };
139         desc.setSchemaType("string");
140         desc.setHandler(handler);
141         desc.setNameSpaceURI("http://castor.exolab.org/Test");
142         desc.setRequired(true);
143         desc.setMultivalued(false);
144         addFieldDescriptor(desc);
145         addSequenceElement(desc);
146 
147         //-- validation code for: _className
148         fieldValidator = new org.exolab.castor.xml.FieldValidator();
149         fieldValidator.setMinOccurs(1);
150         { //-- local scope
151             org.exolab.castor.xml.validators.StringValidator typeValidator;
152             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
153             fieldValidator.setValidator(typeValidator);
154             typeValidator.setWhiteSpace("preserve");
155         }
156         desc.setValidator(fieldValidator);
157         //-- _type
158         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.types.TypeType.class, "_type", "Type", org.exolab.castor.xml.NodeType.Element);
159         handler = new org.exolab.castor.xml.XMLFieldHandler() {
160             public java.lang.Object getValue( java.lang.Object object ) 
161                 throws IllegalStateException
162             {
163                 ListenerType target = (ListenerType) object;
164                 return target.getType();
165             }
166             public void setValue( java.lang.Object object, java.lang.Object value) 
167                 throws IllegalStateException, IllegalArgumentException
168             {
169                 try {
170                     ListenerType target = (ListenerType) object;
171                     target.setType( (org.exolab.castor.tests.framework.testDescriptor.types.TypeType) value);
172                 } catch (java.lang.Exception ex) {
173                     throw new IllegalStateException(ex.toString());
174                 }
175             }
176             public java.lang.Object newInstance(java.lang.Object parent) {
177                 return null;
178             }
179         };
180         handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(org.exolab.castor.tests.framework.testDescriptor.types.TypeType.class, handler);
181         desc.setImmutable(true);
182         desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.types.TypeType");
183         desc.setHandler(handler);
184         desc.setNameSpaceURI("http://castor.exolab.org/Test");
185         desc.setRequired(true);
186         desc.setMultivalued(false);
187         addFieldDescriptor(desc);
188         addSequenceElement(desc);
189 
190         //-- validation code for: _type
191         fieldValidator = new org.exolab.castor.xml.FieldValidator();
192         fieldValidator.setMinOccurs(1);
193         { //-- local scope
194         }
195         desc.setValidator(fieldValidator);
196     }
197 
198 
199       //-----------/
200      //- Methods -/
201     //-----------/
202 
203     /**
204      * Method getAccessMode.
205      * 
206      * @return the access mode specified for this class.
207      */
208     public org.exolab.castor.mapping.AccessMode getAccessMode(
209     ) {
210         return null;
211     }
212 
213     /**
214      * Method getIdentity.
215      * 
216      * @return the identity field, null if this class has no
217      * identity.
218      */
219     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
220     ) {
221         return _identity;
222     }
223 
224     /**
225      * Method getJavaClass.
226      * 
227      * @return the Java class represented by this descriptor.
228      */
229     public java.lang.Class getJavaClass(
230     ) {
231         return org.exolab.castor.tests.framework.testDescriptor.ListenerType.class;
232     }
233 
234     /**
235      * Method getNameSpacePrefix.
236      * 
237      * @return the namespace prefix to use when marshaling as XML.
238      */
239     public java.lang.String getNameSpacePrefix(
240     ) {
241         return _nsPrefix;
242     }
243 
244     /**
245      * Method getNameSpaceURI.
246      * 
247      * @return the namespace URI used when marshaling and
248      * unmarshaling as XML.
249      */
250     public java.lang.String getNameSpaceURI(
251     ) {
252         return _nsURI;
253     }
254 
255     /**
256      * Method getValidator.
257      * 
258      * @return a specific validator for the class described by this
259      * ClassDescriptor.
260      */
261     public org.exolab.castor.xml.TypeValidator getValidator(
262     ) {
263         return this;
264     }
265 
266     /**
267      * Method getXMLName.
268      * 
269      * @return the XML Name for the Class being described.
270      */
271     public java.lang.String getXMLName(
272     ) {
273         return _xmlName;
274     }
275 
276     /**
277      * Method isElementDefinition.
278      * 
279      * @return true if XML schema definition of this Class is that
280      * of a global
281      * element or element with anonymous type definition.
282      */
283     public boolean isElementDefinition(
284     ) {
285         return _elementDefinition;
286     }
287 
288 }