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.Interface;
15  
16  /**
17   * Class InterfaceDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class InterfaceDescriptor 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 InterfaceDescriptor() {
59          super();
60          _nsURI = "http://www.castor.org/SourceGenerator/Binding";
61          _xmlName = "interface";
62          _elementDefinition = true;
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                  Interface target = (Interface) 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                      Interface target = (Interface) 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.setRequired(true);
95          desc.setMultivalued(false);
96          addFieldDescriptor(desc);
97  
98          //-- validation code for: _name
99          fieldValidator = new org.exolab.castor.xml.FieldValidator();
100         fieldValidator.setMinOccurs(1);
101         { //-- local scope
102             org.exolab.castor.xml.validators.StringValidator typeValidator;
103             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
104             fieldValidator.setValidator(typeValidator);
105             typeValidator.setWhiteSpace("preserve");
106         }
107         desc.setValidator(fieldValidator);
108         //-- initialize element descriptors
109 
110     }
111 
112 
113       //-----------/
114      //- Methods -/
115     //-----------/
116 
117     /**
118      * Method getAccessMode.
119      * 
120      * @return the access mode specified for this class.
121      */
122     public org.exolab.castor.mapping.AccessMode getAccessMode(
123     ) {
124         return null;
125     }
126 
127     /**
128      * Method getIdentity.
129      * 
130      * @return the identity field, null if this class has no
131      * identity.
132      */
133     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
134     ) {
135         return _identity;
136     }
137 
138     /**
139      * Method getJavaClass.
140      * 
141      * @return the Java class represented by this descriptor.
142      */
143     public java.lang.Class getJavaClass(
144     ) {
145         return org.exolab.castor.builder.binding.xml.Interface.class;
146     }
147 
148     /**
149      * Method getNameSpacePrefix.
150      * 
151      * @return the namespace prefix to use when marshaling as XML.
152      */
153     public java.lang.String getNameSpacePrefix(
154     ) {
155         return _nsPrefix;
156     }
157 
158     /**
159      * Method getNameSpaceURI.
160      * 
161      * @return the namespace URI used when marshaling and
162      * unmarshaling as XML.
163      */
164     public java.lang.String getNameSpaceURI(
165     ) {
166         return _nsURI;
167     }
168 
169     /**
170      * Method getValidator.
171      * 
172      * @return a specific validator for the class described by this
173      * ClassDescriptor.
174      */
175     public org.exolab.castor.xml.TypeValidator getValidator(
176     ) {
177         return this;
178     }
179 
180     /**
181      * Method getXMLName.
182      * 
183      * @return the XML Name for the Class being described.
184      */
185     public java.lang.String getXMLName(
186     ) {
187         return _xmlName;
188     }
189 
190     /**
191      * Method isElementDefinition.
192      * 
193      * @return true if XML schema definition of this Class is that
194      * of a global
195      * element or element with anonymous type definition.
196      */
197     public boolean isElementDefinition(
198     ) {
199         return _elementDefinition;
200     }
201 
202 }