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.Param;
15  
16  /**
17   * Class ParamDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class ParamDescriptor 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 ParamDescriptor() {
59          super();
60          _nsURI = "http://castor.exolab.org/";
61          _xmlName = "param";
62          _elementDefinition = true;
63          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
64          org.exolab.castor.mapping.FieldHandler             handler        = null;
65          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
66          //-- initialize attribute descriptors
67  
68          //-- _name
69          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
70          desc.setImmutable(true);
71          handler = new org.exolab.castor.xml.XMLFieldHandler() {
72              @Override
73              public java.lang.Object getValue( java.lang.Object object ) 
74                  throws IllegalStateException
75              {
76                  Param target = (Param) object;
77                  return target.getName();
78              }
79              @Override
80              public void setValue( java.lang.Object object, java.lang.Object value) 
81                  throws IllegalStateException, IllegalArgumentException
82              {
83                  try {
84                      Param target = (Param) object;
85                      target.setName( (java.lang.String) value);
86                  } catch (java.lang.Exception ex) {
87                      throw new IllegalStateException(ex.toString());
88                  }
89              }
90              @Override
91              @SuppressWarnings("unused")
92              public java.lang.Object newInstance(java.lang.Object parent) {
93                  return null;
94              }
95          };
96          desc.setSchemaType("string");
97          desc.setHandler(handler);
98          desc.setRequired(true);
99          desc.setMultivalued(false);
100         addFieldDescriptor(desc);
101 
102         //-- validation code for: _name
103         fieldValidator = new org.exolab.castor.xml.FieldValidator();
104         fieldValidator.setMinOccurs(1);
105         { //-- local scope
106             org.exolab.castor.xml.validators.StringValidator typeValidator;
107             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
108             fieldValidator.setValidator(typeValidator);
109             typeValidator.setWhiteSpace("preserve");
110         }
111         desc.setValidator(fieldValidator);
112         //-- _value
113         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);
114         desc.setImmutable(true);
115         handler = new org.exolab.castor.xml.XMLFieldHandler() {
116             @Override
117             public java.lang.Object getValue( java.lang.Object object ) 
118                 throws IllegalStateException
119             {
120                 Param target = (Param) object;
121                 return target.getValue();
122             }
123             @Override
124             public void setValue( java.lang.Object object, java.lang.Object value) 
125                 throws IllegalStateException, IllegalArgumentException
126             {
127                 try {
128                     Param target = (Param) object;
129                     target.setValue( (java.lang.String) value);
130                 } catch (java.lang.Exception ex) {
131                     throw new IllegalStateException(ex.toString());
132                 }
133             }
134             @Override
135             @SuppressWarnings("unused")
136             public java.lang.Object newInstance(java.lang.Object parent) {
137                 return null;
138             }
139         };
140         desc.setSchemaType("string");
141         desc.setHandler(handler);
142         desc.setRequired(true);
143         desc.setMultivalued(false);
144         addFieldDescriptor(desc);
145 
146         //-- validation code for: _value
147         fieldValidator = new org.exolab.castor.xml.FieldValidator();
148         fieldValidator.setMinOccurs(1);
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     }
159 
160 
161       //-----------/
162      //- Methods -/
163     //-----------/
164 
165     /**
166      * Method getAccessMode.
167      * 
168      * @return the access mode specified for this class.
169      */
170     @Override()
171     public org.exolab.castor.mapping.AccessMode getAccessMode(
172     ) {
173         return null;
174     }
175 
176     /**
177      * Method getIdentity.
178      * 
179      * @return the identity field, null if this class has no
180      * identity.
181      */
182     @Override()
183     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
184     ) {
185         return _identity;
186     }
187 
188     /**
189      * Method getJavaClass.
190      * 
191      * @return the Java class represented by this descriptor.
192      */
193     @Override()
194     public java.lang.Class getJavaClass(
195     ) {
196         return org.exolab.castor.mapping.xml.Param.class;
197     }
198 
199     /**
200      * Method getNameSpacePrefix.
201      * 
202      * @return the namespace prefix to use when marshaling as XML.
203      */
204     @Override()
205     public java.lang.String getNameSpacePrefix(
206     ) {
207         return _nsPrefix;
208     }
209 
210     /**
211      * Method getNameSpaceURI.
212      * 
213      * @return the namespace URI used when marshaling and
214      * unmarshaling as XML.
215      */
216     @Override()
217     public java.lang.String getNameSpaceURI(
218     ) {
219         return _nsURI;
220     }
221 
222     /**
223      * Method getValidator.
224      * 
225      * @return a specific validator for the class described by this
226      * ClassDescriptor.
227      */
228     @Override()
229     public org.exolab.castor.xml.TypeValidator getValidator(
230     ) {
231         return this;
232     }
233 
234     /**
235      * Method getXMLName.
236      * 
237      * @return the XML Name for the Class being described.
238      */
239     @Override()
240     public java.lang.String getXMLName(
241     ) {
242         return _xmlName;
243     }
244 
245     /**
246      * Method isElementDefinition.
247      * 
248      * @return true if XML schema definition of this Class is that
249      * of a global
250      * element or element with anonymous type definition.
251      */
252     public boolean isElementDefinition(
253     ) {
254         return _elementDefinition;
255     }
256 
257 }