Statistics
| Revision:

root / trunk / frameworks / _fwAndami / src / com / iver / andami / config / generate / PluginDescriptor.java @ 9956

History | View | Annotate | Download (6.48 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: PluginDescriptor.java 9956 2007-01-29 11:50:30Z caballero $
6
 */
7

    
8
package com.iver.andami.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 PluginDescriptor.
21
 * 
22
 * @version $Revision: 9956 $ $Date: 2007-01-29 12:50:30 +0100 (Mon, 29 Jan 2007) $
23
 */
24
public class PluginDescriptor 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 PluginDescriptor() {
57
        super();
58
        xmlName = "plugin";
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
        //-- _name
65
        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", 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
                Plugin target = (Plugin) object;
71
                return target.getName();
72
            }
73
            public void setValue( java.lang.Object object, java.lang.Object value) 
74
                throws IllegalStateException, IllegalArgumentException
75
            {
76
                try {
77
                    Plugin target = (Plugin) object;
78
                    target.setName( (java.lang.String) value);
79
                }
80
                catch (java.lang.Exception ex) {
81
                    throw new IllegalStateException(ex.toString());
82
                }
83
            }
84
            public java.lang.Object newInstance( java.lang.Object parent ) {
85
                return new java.lang.String();
86
            }
87
        } );
88
        desc.setHandler(handler);
89
        desc.setRequired(true);
90
        addFieldDescriptor(desc);
91
        
92
        //-- validation code for: _name
93
        fieldValidator = new org.exolab.castor.xml.FieldValidator();
94
        fieldValidator.setMinOccurs(1);
95
        { //-- local scope
96
            NameValidator typeValidator = new NameValidator(NameValidator.NMTOKEN);
97
            fieldValidator.setValidator(typeValidator);
98
        }
99
        desc.setValidator(fieldValidator);
100
        //-- _update
101
        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_update", "update", org.exolab.castor.xml.NodeType.Attribute);
102
        handler = (new org.exolab.castor.xml.XMLFieldHandler() {
103
            public java.lang.Object getValue( java.lang.Object object ) 
104
                throws IllegalStateException
105
            {
106
                Plugin target = (Plugin) object;
107
                if(!target.hasUpdate())
108
                    return null;
109
                return (target.getUpdate() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
110
            }
111
            public void setValue( java.lang.Object object, java.lang.Object value) 
112
                throws IllegalStateException, IllegalArgumentException
113
            {
114
                try {
115
                    Plugin target = (Plugin) object;
116
                    // ignore null values for non optional primitives
117
                    if (value == null) return;
118
                    
119
                    target.setUpdate( ((java.lang.Boolean)value).booleanValue());
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 null;
127
            }
128
        } );
129
        desc.setHandler(handler);
130
        desc.setRequired(true);
131
        addFieldDescriptor(desc);
132
        
133
        //-- validation code for: _update
134
        fieldValidator = new org.exolab.castor.xml.FieldValidator();
135
        fieldValidator.setMinOccurs(1);
136
        { //-- local scope
137
            BooleanValidator typeValidator = new BooleanValidator();
138
            fieldValidator.setValidator(typeValidator);
139
        }
140
        desc.setValidator(fieldValidator);
141
        //-- initialize element descriptors
142
        
143
    } //-- com.iver.andami.config.generate.PluginDescriptor()
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 com.iver.andami.config.generate.Plugin.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
}