View Javadoc

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