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