1
2
3
4
5
6
7
8 package org.apache.jetspeed.xml.api.jcm;
9
10
11
12
13
14 import org.exolab.castor.mapping.AccessMode;
15 import org.exolab.castor.mapping.ClassDescriptor;
16 import org.exolab.castor.mapping.FieldDescriptor;
17 import org.exolab.castor.xml.*;
18 import org.exolab.castor.xml.FieldValidator;
19 import org.exolab.castor.xml.TypeValidator;
20 import org.exolab.castor.xml.XMLFieldDescriptor;
21 import org.exolab.castor.xml.handlers.*;
22 import org.exolab.castor.xml.util.XMLFieldDescriptorImpl;
23 import org.exolab.castor.xml.validators.*;
24
25 /***
26 *
27 * @version $Revision$ $Date$
28 **/
29 public class TopicsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
30
31
32
33
34
35
36 private java.lang.String nsPrefix;
37
38 private java.lang.String nsURI;
39
40 private java.lang.String xmlName;
41
42 private org.exolab.castor.xml.XMLFieldDescriptor identity;
43
44
45
46
47
48
49 public TopicsDescriptor() {
50 super();
51 nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content";
52 xmlName = "topics";
53 XMLFieldDescriptorImpl desc = null;
54 XMLFieldHandler handler = null;
55 FieldValidator fieldValidator = null;
56
57
58
59
60
61 desc = new XMLFieldDescriptorImpl(Entry.class, "_entryList", "entry", NodeType.Element);
62 handler = (new XMLFieldHandler() {
63 public Object getValue( Object object )
64 throws IllegalStateException
65 {
66 Topics target = (Topics) object;
67 return target.getEntry();
68 }
69 public void setValue( Object object, Object value)
70 throws IllegalStateException, IllegalArgumentException
71 {
72 try {
73 Topics target = (Topics) object;
74 target.addEntry( (Entry) value);
75 }
76 catch (Exception ex) {
77 throw new IllegalStateException(ex.toString());
78 }
79 }
80 public Object newInstance( Object parent ) {
81 return new Entry();
82 }
83 } );
84 desc.setHandler(handler);
85 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
86 desc.setRequired(true);
87 desc.setMultivalued(true);
88 addFieldDescriptor(desc);
89
90
91 fieldValidator = new FieldValidator();
92 fieldValidator.setMinOccurs(1);
93 desc.setValidator(fieldValidator);
94
95 }
96
97
98
99
100
101
102 /***
103 **/
104 public org.exolab.castor.mapping.AccessMode getAccessMode()
105 {
106 return null;
107 }
108
109 /***
110 **/
111 public org.exolab.castor.mapping.ClassDescriptor getExtends()
112 {
113 return null;
114 }
115
116 /***
117 **/
118 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
119 {
120 return identity;
121 }
122
123 /***
124 **/
125 public java.lang.Class getJavaClass()
126 {
127 return org.apache.jetspeed.xml.api.jcm.Topics.class;
128 }
129
130 /***
131 **/
132 public java.lang.String getNameSpacePrefix()
133 {
134 return nsPrefix;
135 }
136
137 /***
138 **/
139 public java.lang.String getNameSpaceURI()
140 {
141 return nsURI;
142 }
143
144 /***
145 **/
146 public org.exolab.castor.xml.TypeValidator getValidator()
147 {
148 return this;
149 }
150
151 /***
152 **/
153 public java.lang.String getXMLName()
154 {
155 return xmlName;
156 }
157
158 }