001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
004: * Schema.
005: * $Id$
006: */
007:
008: package com.calipso.reportgenerator.reportdefinitions;
009:
010: //---------------------------------/
011: //- Imported classes and packages -/
012: //---------------------------------/
013:
014: import org.exolab.castor.mapping.AccessMode;
015: import org.exolab.castor.xml.TypeValidator;
016: import org.exolab.castor.xml.XMLFieldDescriptor;
017: import org.exolab.castor.xml.validators.*;
018:
019: /**
020: * Class LocalizationDescriptor.
021: *
022: * @version $Revision$ $Date$
023: */
024: public class LocalizationDescriptor extends
025: org.exolab.castor.xml.util.XMLClassDescriptorImpl {
026:
027: //--------------------------/
028: //- Class/Member Variables -/
029: //--------------------------/
030:
031: /**
032: * Field nsPrefix
033: */
034: private java.lang.String nsPrefix;
035:
036: /**
037: * Field nsURI
038: */
039: private java.lang.String nsURI;
040:
041: /**
042: * Field xmlName
043: */
044: private java.lang.String xmlName;
045:
046: /**
047: * Field identity
048: */
049: private org.exolab.castor.xml.XMLFieldDescriptor identity;
050:
051: //----------------/
052: //- Constructors -/
053: //----------------/
054:
055: public LocalizationDescriptor() {
056: super ();
057: xmlName = "Localization";
058:
059: //-- set grouping compositor
060: setCompositorAsSequence();
061: org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
062: org.exolab.castor.xml.XMLFieldHandler handler = null;
063: org.exolab.castor.xml.FieldValidator fieldValidator = null;
064: //-- initialize attribute descriptors
065:
066: //-- _locale
067: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
068: java.lang.String.class, "_locale", "Locale",
069: org.exolab.castor.xml.NodeType.Attribute);
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: Localization target = (Localization) object;
075: return target.getLocale();
076: }
077:
078: public void setValue(java.lang.Object object,
079: java.lang.Object value)
080: throws IllegalStateException,
081: IllegalArgumentException {
082: try {
083: Localization target = (Localization) object;
084: target.setLocale((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: addFieldDescriptor(desc);
097:
098: //-- validation code for: _locale
099: fieldValidator = new org.exolab.castor.xml.FieldValidator();
100: fieldValidator.setMinOccurs(1);
101: { //-- local scope
102: StringValidator typeValidator = new StringValidator();
103: typeValidator.setWhiteSpace("preserve");
104: fieldValidator.setValidator(typeValidator);
105: }
106: desc.setValidator(fieldValidator);
107: //-- initialize element descriptors
108:
109: //-- _literalsList
110: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
111: com.calipso.reportgenerator.reportdefinitions.Literals.class,
112: "_literalsList", "Literals",
113: org.exolab.castor.xml.NodeType.Element);
114: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
115: public java.lang.Object getValue(java.lang.Object object)
116: throws IllegalStateException {
117: Localization target = (Localization) object;
118: return target.getLiterals();
119: }
120:
121: public void setValue(java.lang.Object object,
122: java.lang.Object value)
123: throws IllegalStateException,
124: IllegalArgumentException {
125: try {
126: Localization target = (Localization) object;
127: target
128: .addLiterals((com.calipso.reportgenerator.reportdefinitions.Literals) value);
129: } catch (java.lang.Exception ex) {
130: throw new IllegalStateException(ex.toString());
131: }
132: }
133:
134: public java.lang.Object newInstance(java.lang.Object parent) {
135: return new com.calipso.reportgenerator.reportdefinitions.Literals();
136: }
137: });
138: desc.setHandler(handler);
139: desc.setMultivalued(true);
140: addFieldDescriptor(desc);
141:
142: //-- validation code for: _literalsList
143: fieldValidator = new org.exolab.castor.xml.FieldValidator();
144: fieldValidator.setMinOccurs(0);
145: { //-- local scope
146: }
147: desc.setValidator(fieldValidator);
148: } //-- com.calipso.reportgenerator.reportdefinitions.LocalizationDescriptor()
149:
150: //-----------/
151: //- Methods -/
152: //-----------/
153:
154: /**
155: * Method getAccessMode
156: */
157: public org.exolab.castor.mapping.AccessMode getAccessMode() {
158: return null;
159: } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
160:
161: /**
162: * Method getExtends
163: */
164: public org.exolab.castor.mapping.ClassDescriptor getExtends() {
165: return null;
166: } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
167:
168: /**
169: * Method getIdentity
170: */
171: public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
172: return identity;
173: } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
174:
175: /**
176: * Method getJavaClass
177: */
178: public java.lang.Class getJavaClass() {
179: return com.calipso.reportgenerator.reportdefinitions.Localization.class;
180: } //-- java.lang.Class getJavaClass()
181:
182: /**
183: * Method getNameSpacePrefix
184: */
185: public java.lang.String getNameSpacePrefix() {
186: return nsPrefix;
187: } //-- java.lang.String getNameSpacePrefix()
188:
189: /**
190: * Method getNameSpaceURI
191: */
192: public java.lang.String getNameSpaceURI() {
193: return nsURI;
194: } //-- java.lang.String getNameSpaceURI()
195:
196: /**
197: * Method getValidator
198: */
199: public org.exolab.castor.xml.TypeValidator getValidator() {
200: return this ;
201: } //-- org.exolab.castor.xml.TypeValidator getValidator()
202:
203: /**
204: * Method getXMLName
205: */
206: public java.lang.String getXMLName() {
207: return xmlName;
208: } //-- java.lang.String getXMLName()
209:
210: }
|