Statistics
| Revision:

root / branches / v2_0_0_prep / frameworks / _fwAndami / src / org / gvsig / andami / plugins / config / generate / LabelDescriptor.java @ 29593

History | View | Annotate | Download (6.43 KB)

1
/*
2
 * This class was automatically generated with 
3
 * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
4
 * Schema.
5
 * $Id: LabelDescriptor.java 29593 2009-06-29 15:54:31Z jpiera $
6
 */
7

    
8
package org.gvsig.andami.plugins.config.generate;
9

    
10
  //---------------------------------/
11
 //- Imported classes and packages -/
12
//---------------------------------/
13

    
14
import org.exolab.castor.mapping.AccessMode;
15
import org.exolab.castor.xml.TypeValidator;
16
import org.exolab.castor.xml.XMLFieldDescriptor;
17
import org.exolab.castor.xml.validators.*;
18

    
19
/**
20
 * Class LabelDescriptor.
21
 * 
22
 * @version $Revision: 29593 $ $Date: 2009-06-29 17:54:31 +0200 (Mon, 29 Jun 2009) $
23
 */
24
public class LabelDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
25

    
26

    
27
      //--------------------------/
28
     //- Class/Member Variables -/
29
    //--------------------------/
30

    
31
    /**
32
     * Field nsPrefix
33
     */
34
    private java.lang.String nsPrefix;
35

    
36
    /**
37
     * Field nsURI
38
     */
39
    private java.lang.String nsURI;
40

    
41
    /**
42
     * Field xmlName
43
     */
44
    private java.lang.String xmlName;
45

    
46
    /**
47
     * Field identity
48
     */
49
    private org.exolab.castor.xml.XMLFieldDescriptor identity;
50

    
51

    
52
      //----------------/
53
     //- Constructors -/
54
    //----------------/
55

    
56
    public LabelDescriptor() {
57
        super();
58
        xmlName = "label";
59
        org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
60
        org.exolab.castor.xml.XMLFieldHandler              handler        = null;
61
        org.exolab.castor.xml.FieldValidator               fieldValidator = null;
62
        //-- initialize attribute descriptors
63
        
64
        //-- _size
65
        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_size", "size", org.exolab.castor.xml.NodeType.Attribute);
66
        handler = (new org.exolab.castor.xml.XMLFieldHandler() {
67
            public java.lang.Object getValue( java.lang.Object object ) 
68
                throws IllegalStateException
69
            {
70
                Label target = (Label) object;
71
                if(!target.hasSize())
72
                    return null;
73
                return new java.lang.Integer(target.getSize());
74
            }
75
            public void setValue( java.lang.Object object, java.lang.Object value) 
76
                throws IllegalStateException, IllegalArgumentException
77
            {
78
                try {
79
                    Label target = (Label) object;
80
                    // ignore null values for non optional primitives
81
                    if (value == null) return;
82
                    
83
                    target.setSize( ((java.lang.Integer)value).intValue());
84
                }
85
                catch (java.lang.Exception ex) {
86
                    throw new IllegalStateException(ex.toString());
87
                }
88
            }
89
            public java.lang.Object newInstance( java.lang.Object parent ) {
90
                return null;
91
            }
92
        } );
93
        desc.setHandler(handler);
94
        desc.setRequired(true);
95
        addFieldDescriptor(desc);
96
        
97
        //-- validation code for: _size
98
        fieldValidator = new org.exolab.castor.xml.FieldValidator();
99
        fieldValidator.setMinOccurs(1);
100
        { //-- local scope
101
            IntegerValidator typeValidator= new IntegerValidator();
102
            fieldValidator.setValidator(typeValidator);
103
        }
104
        desc.setValidator(fieldValidator);
105
        //-- _id
106
        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
107
        handler = (new org.exolab.castor.xml.XMLFieldHandler() {
108
            public java.lang.Object getValue( java.lang.Object object ) 
109
                throws IllegalStateException
110
            {
111
                Label target = (Label) object;
112
                return target.getId();
113
            }
114
            public void setValue( java.lang.Object object, java.lang.Object value) 
115
                throws IllegalStateException, IllegalArgumentException
116
            {
117
                try {
118
                    Label target = (Label) object;
119
                    target.setId( (java.lang.String) value);
120
                }
121
                catch (java.lang.Exception ex) {
122
                    throw new IllegalStateException(ex.toString());
123
                }
124
            }
125
            public java.lang.Object newInstance( java.lang.Object parent ) {
126
                return new java.lang.String();
127
            }
128
        } );
129
        desc.setHandler(handler);
130
        desc.setRequired(true);
131
        addFieldDescriptor(desc);
132
        
133
        //-- validation code for: _id
134
        fieldValidator = new org.exolab.castor.xml.FieldValidator();
135
        fieldValidator.setMinOccurs(1);
136
        { //-- local scope
137
            NameValidator typeValidator = new NameValidator(NameValidator.NMTOKEN);
138
            fieldValidator.setValidator(typeValidator);
139
        }
140
        desc.setValidator(fieldValidator);
141
        //-- initialize element descriptors
142
        
143
    } //-- com.iver.andami.plugins.config.generate.LabelDescriptor()
144

    
145

    
146
      //-----------/
147
     //- Methods -/
148
    //-----------/
149

    
150
    /**
151
     * Method getAccessMode
152
     */
153
    public org.exolab.castor.mapping.AccessMode getAccessMode()
154
    {
155
        return null;
156
    } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
157

    
158
    /**
159
     * Method getExtends
160
     */
161
    public org.exolab.castor.mapping.ClassDescriptor getExtends()
162
    {
163
        return null;
164
    } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
165

    
166
    /**
167
     * Method getIdentity
168
     */
169
    public org.exolab.castor.mapping.FieldDescriptor getIdentity()
170
    {
171
        return identity;
172
    } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
173

    
174
    /**
175
     * Method getJavaClass
176
     */
177
    public java.lang.Class getJavaClass()
178
    {
179
        return org.gvsig.andami.plugins.config.generate.Label.class;
180
    } //-- java.lang.Class getJavaClass() 
181

    
182
    /**
183
     * Method getNameSpacePrefix
184
     */
185
    public java.lang.String getNameSpacePrefix()
186
    {
187
        return nsPrefix;
188
    } //-- java.lang.String getNameSpacePrefix() 
189

    
190
    /**
191
     * Method getNameSpaceURI
192
     */
193
    public java.lang.String getNameSpaceURI()
194
    {
195
        return nsURI;
196
    } //-- java.lang.String getNameSpaceURI() 
197

    
198
    /**
199
     * Method getValidator
200
     */
201
    public org.exolab.castor.xml.TypeValidator getValidator()
202
    {
203
        return this;
204
    } //-- org.exolab.castor.xml.TypeValidator getValidator() 
205

    
206
    /**
207
     * Method getXMLName
208
     */
209
    public java.lang.String getXMLName()
210
    {
211
        return xmlName;
212
    } //-- java.lang.String getXMLName() 
213

    
214
}