001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 1.0.2</a>, using an XML
004: * Schema.
005: * $Id: PropertyTypeDescriptor.java 6104 2006-08-23 06:32:44Z wguttmn $
006: */
007:
008: package org.exolab.castor.mapping.xml;
009:
010: /**
011: * Class PropertyTypeDescriptor.
012: *
013: * @version $Revision: 6104 $ $Date: 2006-01-07 15:48:31 -0700 (Sat, 07 Jan 2006) $
014: */
015: public class PropertyTypeDescriptor extends
016: org.exolab.castor.xml.util.XMLClassDescriptorImpl {
017:
018: //--------------------------/
019: //- Class/Member Variables -/
020: //--------------------------/
021:
022: /**
023: * Field elementDefinition
024: */
025: private boolean elementDefinition;
026:
027: /**
028: * Field nsPrefix
029: */
030: private java.lang.String nsPrefix;
031:
032: /**
033: * Field nsURI
034: */
035: private java.lang.String nsURI;
036:
037: /**
038: * Field xmlName
039: */
040: private java.lang.String xmlName;
041:
042: /**
043: * Field identity
044: */
045: private org.exolab.castor.xml.XMLFieldDescriptor identity;
046:
047: //----------------/
048: //- Constructors -/
049: //----------------/
050:
051: public PropertyTypeDescriptor() {
052: super ();
053: nsURI = "http://castor.exolab.org/";
054: xmlName = "propertyType";
055: elementDefinition = false;
056:
057: //-- set grouping compositor
058: setCompositorAsSequence();
059: org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
060: org.exolab.castor.mapping.FieldHandler handler = null;
061: org.exolab.castor.xml.FieldValidator fieldValidator = null;
062: //-- initialize attribute descriptors
063:
064: //-- initialize element descriptors
065:
066: //-- _name
067: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
068: java.lang.String.class, "_name", "name",
069: org.exolab.castor.xml.NodeType.Element);
070: desc.setImmutable(true);
071: handler = new org.exolab.castor.xml.XMLFieldHandler() {
072: public java.lang.Object getValue(java.lang.Object object)
073: throws IllegalStateException {
074: PropertyType target = (PropertyType) object;
075: return target.getName();
076: }
077:
078: public void setValue(java.lang.Object object,
079: java.lang.Object value)
080: throws IllegalStateException,
081: IllegalArgumentException {
082: try {
083: PropertyType target = (PropertyType) object;
084: target.setName((java.lang.String) value);
085: } catch (java.lang.Exception ex) {
086: throw new IllegalStateException(ex.toString());
087: }
088: }
089:
090: public java.lang.Object newInstance(java.lang.Object parent) {
091: return null;
092: }
093: };
094: desc.setHandler(handler);
095: desc.setRequired(true);
096: desc.setMultivalued(false);
097: addFieldDescriptor(desc);
098:
099: //-- validation code for: _name
100: fieldValidator = new org.exolab.castor.xml.FieldValidator();
101: fieldValidator.setMinOccurs(1);
102: { //-- local scope
103: org.exolab.castor.xml.validators.StringValidator typeValidator = new org.exolab.castor.xml.validators.StringValidator();
104: typeValidator.setWhiteSpace("preserve");
105: fieldValidator.setValidator(typeValidator);
106: }
107: desc.setValidator(fieldValidator);
108: //-- _value
109: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
110: java.lang.String.class, "_value", "value",
111: org.exolab.castor.xml.NodeType.Element);
112: desc.setImmutable(true);
113: handler = new org.exolab.castor.xml.XMLFieldHandler() {
114: public java.lang.Object getValue(java.lang.Object object)
115: throws IllegalStateException {
116: PropertyType target = (PropertyType) object;
117: return target.getValue();
118: }
119:
120: public void setValue(java.lang.Object object,
121: java.lang.Object value)
122: throws IllegalStateException,
123: IllegalArgumentException {
124: try {
125: PropertyType target = (PropertyType) object;
126: target.setValue((java.lang.String) value);
127: } catch (java.lang.Exception ex) {
128: throw new IllegalStateException(ex.toString());
129: }
130: }
131:
132: public java.lang.Object newInstance(java.lang.Object parent) {
133: return null;
134: }
135: };
136: desc.setHandler(handler);
137: desc.setRequired(true);
138: desc.setMultivalued(false);
139: addFieldDescriptor(desc);
140:
141: //-- validation code for: _value
142: fieldValidator = new org.exolab.castor.xml.FieldValidator();
143: fieldValidator.setMinOccurs(1);
144: { //-- local scope
145: org.exolab.castor.xml.validators.StringValidator typeValidator = new org.exolab.castor.xml.validators.StringValidator();
146: typeValidator.setWhiteSpace("preserve");
147: fieldValidator.setValidator(typeValidator);
148: }
149: desc.setValidator(fieldValidator);
150: } //-- org.exolab.castor.mapping.xml.PropertyTypeDescriptor()
151:
152: //-----------/
153: //- Methods -/
154: //-----------/
155:
156: /**
157: * Method getAccessMode
158: *
159: *
160: *
161: * @return AccessMode
162: */
163: public org.exolab.castor.mapping.AccessMode getAccessMode() {
164: return null;
165: } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
166:
167: /**
168: * Method getExtends
169: *
170: *
171: *
172: * @return ClassDescriptor
173: */
174: public org.exolab.castor.mapping.ClassDescriptor getExtends() {
175: return null;
176: } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
177:
178: /**
179: * Method getIdentity
180: *
181: *
182: *
183: * @return FieldDescriptor
184: */
185: public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
186: return identity;
187: } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
188:
189: /**
190: * Method getJavaClass
191: *
192: *
193: *
194: * @return Class
195: */
196: public java.lang.Class getJavaClass() {
197: return org.exolab.castor.mapping.xml.PropertyType.class;
198: } //-- java.lang.Class getJavaClass()
199:
200: /**
201: * Method getNameSpacePrefix
202: *
203: *
204: *
205: * @return String
206: */
207: public java.lang.String getNameSpacePrefix() {
208: return nsPrefix;
209: } //-- java.lang.String getNameSpacePrefix()
210:
211: /**
212: * Method getNameSpaceURI
213: *
214: *
215: *
216: * @return String
217: */
218: public java.lang.String getNameSpaceURI() {
219: return nsURI;
220: } //-- java.lang.String getNameSpaceURI()
221:
222: /**
223: * Method getValidator
224: *
225: *
226: *
227: * @return TypeValidator
228: */
229: public org.exolab.castor.xml.TypeValidator getValidator() {
230: return this ;
231: } //-- org.exolab.castor.xml.TypeValidator getValidator()
232:
233: /**
234: * Method getXMLName
235: *
236: *
237: *
238: * @return String
239: */
240: public java.lang.String getXMLName() {
241: return xmlName;
242: } //-- java.lang.String getXMLName()
243:
244: /**
245: * Method isElementDefinition
246: *
247: *
248: *
249: * @return boolean
250: */
251: public boolean isElementDefinition() {
252: return elementDefinition;
253: } //-- boolean isElementDefinition()
254:
255: }
|