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.mapping.xml.descriptors;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.exolab.castor.mapping.xml.KeyGeneratorDef;
15  
16  /**
17   * Class KeyGeneratorDefDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class KeyGeneratorDefDescriptor 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 KeyGeneratorDefDescriptor() {
59          super();
60          _nsURI = "http://castor.exolab.org/";
61          _xmlName = "key-generator";
62          _elementDefinition = true;
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          //-- _name
72          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
73          this._identity = desc;
74          handler = new org.exolab.castor.xml.XMLFieldHandler() {
75              @Override
76              public java.lang.Object getValue( java.lang.Object object ) 
77                  throws IllegalStateException
78              {
79                  KeyGeneratorDef target = (KeyGeneratorDef) object;
80                  return target.getName();
81              }
82              @Override
83              public void setValue( java.lang.Object object, java.lang.Object value) 
84                  throws IllegalStateException, IllegalArgumentException
85              {
86                  try {
87                      KeyGeneratorDef target = (KeyGeneratorDef) object;
88                      target.setName( (java.lang.String) value);
89                  } catch (java.lang.Exception ex) {
90                      throw new IllegalStateException(ex.toString());
91                  }
92              }
93              @Override
94              @SuppressWarnings("unused")
95              public java.lang.Object newInstance(java.lang.Object parent) {
96                  return new java.lang.String();
97              }
98          };
99          desc.setSchemaType("ID");
100         desc.setHandler(handler);
101         desc.setRequired(true);
102         desc.setMultivalued(false);
103         addFieldDescriptor(desc);
104 
105         //-- validation code for: _name
106         fieldValidator = new org.exolab.castor.xml.FieldValidator();
107         fieldValidator.setMinOccurs(1);
108         { //-- local scope
109             org.exolab.castor.xml.validators.IdValidator typeValidator;
110             typeValidator = new org.exolab.castor.xml.validators.IdValidator();
111             fieldValidator.setValidator(typeValidator);
112         }
113         desc.setValidator(fieldValidator);
114         //-- _alias
115         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_alias", "alias", org.exolab.castor.xml.NodeType.Attribute);
116         desc.setImmutable(true);
117         handler = new org.exolab.castor.xml.XMLFieldHandler() {
118             @Override
119             public java.lang.Object getValue( java.lang.Object object ) 
120                 throws IllegalStateException
121             {
122                 KeyGeneratorDef target = (KeyGeneratorDef) object;
123                 return target.getAlias();
124             }
125             @Override
126             public void setValue( java.lang.Object object, java.lang.Object value) 
127                 throws IllegalStateException, IllegalArgumentException
128             {
129                 try {
130                     KeyGeneratorDef target = (KeyGeneratorDef) object;
131                     target.setAlias( (java.lang.String) value);
132                 } catch (java.lang.Exception ex) {
133                     throw new IllegalStateException(ex.toString());
134                 }
135             }
136             @Override
137             @SuppressWarnings("unused")
138             public java.lang.Object newInstance(java.lang.Object parent) {
139                 return null;
140             }
141         };
142         desc.setSchemaType("string");
143         desc.setHandler(handler);
144         desc.setMultivalued(false);
145         addFieldDescriptor(desc);
146 
147         //-- validation code for: _alias
148         fieldValidator = new org.exolab.castor.xml.FieldValidator();
149         { //-- local scope
150             org.exolab.castor.xml.validators.StringValidator typeValidator;
151             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
152             fieldValidator.setValidator(typeValidator);
153             typeValidator.setWhiteSpace("preserve");
154         }
155         desc.setValidator(fieldValidator);
156         //-- initialize element descriptors
157 
158         //-- _paramList
159         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.mapping.xml.Param.class, "_paramList", "param", org.exolab.castor.xml.NodeType.Element);
160         handler = new org.exolab.castor.xml.XMLFieldHandler() {
161             @Override
162             public java.lang.Object getValue( java.lang.Object object ) 
163                 throws IllegalStateException
164             {
165                 KeyGeneratorDef target = (KeyGeneratorDef) object;
166                 return target.getParam();
167             }
168             @Override
169             public void setValue( java.lang.Object object, java.lang.Object value) 
170                 throws IllegalStateException, IllegalArgumentException
171             {
172                 try {
173                     KeyGeneratorDef target = (KeyGeneratorDef) object;
174                     target.addParam( (org.exolab.castor.mapping.xml.Param) value);
175                 } catch (java.lang.Exception ex) {
176                     throw new IllegalStateException(ex.toString());
177                 }
178             }
179             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
180                 try {
181                     KeyGeneratorDef target = (KeyGeneratorDef) object;
182                     target.removeAllParam();
183                 } catch (java.lang.Exception ex) {
184                     throw new IllegalStateException(ex.toString());
185                 }
186             }
187             @Override
188             @SuppressWarnings("unused")
189             public java.lang.Object newInstance(java.lang.Object parent) {
190                 return null;
191             }
192         };
193         desc.setSchemaType("list");
194         desc.setComponentType("org.exolab.castor.mapping.xml.Param");
195         desc.setHandler(handler);
196         desc.setNameSpaceURI("http://castor.exolab.org/");
197         desc.setMultivalued(true);
198         addFieldDescriptor(desc);
199         addSequenceElement(desc);
200 
201         //-- validation code for: _paramList
202         fieldValidator = new org.exolab.castor.xml.FieldValidator();
203         fieldValidator.setMinOccurs(0);
204         { //-- local scope
205         }
206         desc.setValidator(fieldValidator);
207     }
208 
209 
210       //-----------/
211      //- Methods -/
212     //-----------/
213 
214     /**
215      * Method getAccessMode.
216      * 
217      * @return the access mode specified for this class.
218      */
219     @Override()
220     public org.exolab.castor.mapping.AccessMode getAccessMode(
221     ) {
222         return null;
223     }
224 
225     /**
226      * Method getIdentity.
227      * 
228      * @return the identity field, null if this class has no
229      * identity.
230      */
231     @Override()
232     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
233     ) {
234         return _identity;
235     }
236 
237     /**
238      * Method getJavaClass.
239      * 
240      * @return the Java class represented by this descriptor.
241      */
242     @Override()
243     public java.lang.Class getJavaClass(
244     ) {
245         return org.exolab.castor.mapping.xml.KeyGeneratorDef.class;
246     }
247 
248     /**
249      * Method getNameSpacePrefix.
250      * 
251      * @return the namespace prefix to use when marshaling as XML.
252      */
253     @Override()
254     public java.lang.String getNameSpacePrefix(
255     ) {
256         return _nsPrefix;
257     }
258 
259     /**
260      * Method getNameSpaceURI.
261      * 
262      * @return the namespace URI used when marshaling and
263      * unmarshaling as XML.
264      */
265     @Override()
266     public java.lang.String getNameSpaceURI(
267     ) {
268         return _nsURI;
269     }
270 
271     /**
272      * Method getValidator.
273      * 
274      * @return a specific validator for the class described by this
275      * ClassDescriptor.
276      */
277     @Override()
278     public org.exolab.castor.xml.TypeValidator getValidator(
279     ) {
280         return this;
281     }
282 
283     /**
284      * Method getXMLName.
285      * 
286      * @return the XML Name for the Class being described.
287      */
288     @Override()
289     public java.lang.String getXMLName(
290     ) {
291         return _xmlName;
292     }
293 
294     /**
295      * Method isElementDefinition.
296      * 
297      * @return true if XML schema definition of this Class is that
298      * of a global
299      * element or element with anonymous type definition.
300      */
301     public boolean isElementDefinition(
302     ) {
303         return _elementDefinition;
304     }
305 
306 }