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