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