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