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.Element;
15  
16  /**
17   * Class ElementDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class ElementDescriptor 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 ElementDescriptor() {
59          super();
60          _xmlName = "element";
61          _elementDefinition = true;
62          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
63          org.exolab.castor.mapping.FieldHandler             handler        = null;
64          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
65          //-- initialize attribute descriptors
66          
67          //-- _name
68          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
69          desc.setImmutable(true);
70          handler = new org.exolab.castor.xml.XMLFieldHandler() {
71              public java.lang.Object getValue( java.lang.Object object ) 
72                  throws IllegalStateException
73              {
74                  Element target = (Element) object;
75                  return target.getName();
76              }
77              public void setValue( java.lang.Object object, java.lang.Object value) 
78                  throws IllegalStateException, IllegalArgumentException
79              {
80                  try {
81                      Element target = (Element) object;
82                      target.setName( (java.lang.String) value);
83                  } catch (java.lang.Exception ex) {
84                      throw new IllegalStateException(ex.toString());
85                  }
86              }
87              public java.lang.Object newInstance(java.lang.Object parent) {
88                  return null;
89              }
90          };
91          desc.setSchemaType("string");
92          desc.setHandler(handler);
93          desc.setMultivalued(false);
94          addFieldDescriptor(desc);
95          
96          //-- validation code for: _name
97          fieldValidator = new org.exolab.castor.xml.FieldValidator();
98          { //-- local scope
99              org.exolab.castor.xml.validators.StringValidator typeValidator;
100             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
101             fieldValidator.setValidator(typeValidator);
102             typeValidator.setWhiteSpace("preserve");
103         }
104         desc.setValidator(fieldValidator);
105         //-- initialize element descriptors
106         
107     }
108 
109 
110       //-----------/
111      //- Methods -/
112     //-----------/
113 
114     /**
115      * Method getAccessMode.
116      * 
117      * @return the access mode specified for this class.
118      */
119     public org.exolab.castor.mapping.AccessMode getAccessMode(
120     ) {
121         return null;
122     }
123 
124     /**
125      * Method getIdentity.
126      * 
127      * @return the identity field, null if this class has no
128      * identity.
129      */
130     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
131     ) {
132         return _identity;
133     }
134 
135     /**
136      * Method getJavaClass.
137      * 
138      * @return the Java class represented by this descriptor.
139      */
140     public java.lang.Class getJavaClass(
141     ) {
142         return org.sourceforge.mbeanmonitoring.report.castor.Element.class;
143     }
144 
145     /**
146      * Method getNameSpacePrefix.
147      * 
148      * @return the namespace prefix to use when marshaling as XML.
149      */
150     public java.lang.String getNameSpacePrefix(
151     ) {
152         return _nsPrefix;
153     }
154 
155     /**
156      * Method getNameSpaceURI.
157      * 
158      * @return the namespace URI used when marshaling and
159      * unmarshaling as XML.
160      */
161     public java.lang.String getNameSpaceURI(
162     ) {
163         return _nsURI;
164     }
165 
166     /**
167      * Method getValidator.
168      * 
169      * @return a specific validator for the class described by this
170      * ClassDescriptor.
171      */
172     public org.exolab.castor.xml.TypeValidator getValidator(
173     ) {
174         return this;
175     }
176 
177     /**
178      * Method getXMLName.
179      * 
180      * @return the XML Name for the Class being described.
181      */
182     public java.lang.String getXMLName(
183     ) {
184         return _xmlName;
185     }
186 
187     /**
188      * Method isElementDefinition.
189      * 
190      * @return true if XML schema definition of this Class is that
191      * of a global
192      * element or element with anonymous type definition.
193      */
194     public boolean isElementDefinition(
195     ) {
196         return _elementDefinition;
197     }
198 
199 }