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