1 7 8 package org.apache.jetspeed.xml.api.jcm; 9 10 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 29 public class ItemDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { 30 31 32 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 49 public ItemDescriptor() { 50 super(); 51 nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"; 52 xmlName = "item"; 53 XMLFieldDescriptorImpl desc = null; 54 XMLFieldHandler handler = null; 55 FieldValidator fieldValidator = null; 56 58 60 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_topic", "topic", NodeType.Element); 62 desc.setImmutable(true); 63 handler = (new XMLFieldHandler() { 64 public Object getValue( Object object ) 65 throws IllegalStateException 66 { 67 Item target = (Item) object; 68 return target.getTopic(); 69 } 70 public void setValue( Object object, Object value) 71 throws IllegalStateException , IllegalArgumentException 72 { 73 try { 74 Item target = (Item) object; 75 target.setTopic( (java.lang.String ) value); 76 } 77 catch (Exception ex) { 78 throw new IllegalStateException (ex.toString()); 79 } 80 } 81 public Object newInstance( Object parent ) { 82 return null; 83 } 84 } ); 85 desc.setHandler(handler); 86 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 87 desc.setMultivalued(false); 88 addFieldDescriptor(desc); 89 90 fieldValidator = new FieldValidator(); 92 { StringValidator sv = new StringValidator(); 94 sv.setWhiteSpace("preserve"); 95 fieldValidator.setValidator(sv); 96 } 97 desc.setValidator(fieldValidator); 98 99 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_pubDate", "pubDate", NodeType.Element); 101 desc.setImmutable(true); 102 handler = (new XMLFieldHandler() { 103 public Object getValue( Object object ) 104 throws IllegalStateException 105 { 106 Item target = (Item) object; 107 return target.getPubDate(); 108 } 109 public void setValue( Object object, Object value) 110 throws IllegalStateException , IllegalArgumentException 111 { 112 try { 113 Item target = (Item) object; 114 target.setPubDate( (java.lang.String ) value); 115 } 116 catch (Exception ex) { 117 throw new IllegalStateException (ex.toString()); 118 } 119 } 120 public Object newInstance( Object parent ) { 121 return null; 122 } 123 } ); 124 desc.setHandler(handler); 125 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 126 desc.setMultivalued(false); 127 addFieldDescriptor(desc); 128 129 fieldValidator = new FieldValidator(); 131 { StringValidator sv = new StringValidator(); 133 sv.setWhiteSpace("preserve"); 134 fieldValidator.setValidator(sv); 135 } 136 desc.setValidator(fieldValidator); 137 138 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_title", "title", NodeType.Element); 140 desc.setImmutable(true); 141 handler = (new XMLFieldHandler() { 142 public Object getValue( Object object ) 143 throws IllegalStateException 144 { 145 Item target = (Item) object; 146 return target.getTitle(); 147 } 148 public void setValue( Object object, Object value) 149 throws IllegalStateException , IllegalArgumentException 150 { 151 try { 152 Item target = (Item) object; 153 target.setTitle( (java.lang.String ) value); 154 } 155 catch (Exception ex) { 156 throw new IllegalStateException (ex.toString()); 157 } 158 } 159 public Object newInstance( Object parent ) { 160 return null; 161 } 162 } ); 163 desc.setHandler(handler); 164 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 165 desc.setMultivalued(false); 166 addFieldDescriptor(desc); 167 168 fieldValidator = new FieldValidator(); 170 { StringValidator sv = new StringValidator(); 172 sv.setWhiteSpace("preserve"); 173 fieldValidator.setValidator(sv); 174 } 175 desc.setValidator(fieldValidator); 176 177 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_link", "link", NodeType.Element); 179 desc.setImmutable(true); 180 handler = (new XMLFieldHandler() { 181 public Object getValue( Object object ) 182 throws IllegalStateException 183 { 184 Item target = (Item) object; 185 return target.getLink(); 186 } 187 public void setValue( Object object, Object value) 188 throws IllegalStateException , IllegalArgumentException 189 { 190 try { 191 Item target = (Item) object; 192 target.setLink( (java.lang.String ) value); 193 } 194 catch (Exception ex) { 195 throw new IllegalStateException (ex.toString()); 196 } 197 } 198 public Object newInstance( Object parent ) { 199 return null; 200 } 201 } ); 202 desc.setHandler(handler); 203 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 204 desc.setMultivalued(false); 205 addFieldDescriptor(desc); 206 207 fieldValidator = new FieldValidator(); 209 { StringValidator sv = new StringValidator(); 211 sv.setWhiteSpace("preserve"); 212 fieldValidator.setValidator(sv); 213 } 214 desc.setValidator(fieldValidator); 215 216 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_description", "description", NodeType.Element); 218 desc.setImmutable(true); 219 handler = (new XMLFieldHandler() { 220 public Object getValue( Object object ) 221 throws IllegalStateException 222 { 223 Item target = (Item) object; 224 return target.getDescription(); 225 } 226 public void setValue( Object object, Object value) 227 throws IllegalStateException , IllegalArgumentException 228 { 229 try { 230 Item target = (Item) object; 231 target.setDescription( (java.lang.String ) value); 232 } 233 catch (Exception ex) { 234 throw new IllegalStateException (ex.toString()); 235 } 236 } 237 public Object newInstance( Object parent ) { 238 return null; 239 } 240 } ); 241 desc.setHandler(handler); 242 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 243 desc.setMultivalued(false); 244 addFieldDescriptor(desc); 245 246 fieldValidator = new FieldValidator(); 248 { StringValidator sv = new StringValidator(); 250 sv.setWhiteSpace("preserve"); 251 fieldValidator.setValidator(sv); 252 } 253 desc.setValidator(fieldValidator); 254 255 desc = new XMLFieldDescriptorImpl(Quote.class, "_quote", "quote", NodeType.Element); 257 handler = (new XMLFieldHandler() { 258 public Object getValue( Object object ) 259 throws IllegalStateException 260 { 261 Item target = (Item) object; 262 return target.getQuote(); 263 } 264 public void setValue( Object object, Object value) 265 throws IllegalStateException , IllegalArgumentException 266 { 267 try { 268 Item target = (Item) object; 269 target.setQuote( (Quote) value); 270 } 271 catch (Exception ex) { 272 throw new IllegalStateException (ex.toString()); 273 } 274 } 275 public Object newInstance( Object parent ) { 276 return new Quote(); 277 } 278 } ); 279 desc.setHandler(handler); 280 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 281 desc.setMultivalued(false); 282 addFieldDescriptor(desc); 283 284 fieldValidator = new FieldValidator(); 286 desc.setValidator(fieldValidator); 287 288 } 290 291 295 297 public org.exolab.castor.mapping.AccessMode getAccessMode() 298 { 299 return null; 300 } 302 304 public org.exolab.castor.mapping.ClassDescriptor getExtends() 305 { 306 return null; 307 } 309 311 public org.exolab.castor.mapping.FieldDescriptor getIdentity() 312 { 313 return identity; 314 } 316 318 public java.lang.Class getJavaClass() 319 { 320 return org.apache.jetspeed.xml.api.jcm.Item.class; 321 } 323 325 public java.lang.String getNameSpacePrefix() 326 { 327 return nsPrefix; 328 } 330 332 public java.lang.String getNameSpaceURI() 333 { 334 return nsURI; 335 } 337 339 public org.exolab.castor.xml.TypeValidator getValidator() 340 { 341 return this; 342 } 344 346 public java.lang.String getXMLName() 347 { 348 return xmlName; 349 } 351 } 352 | Popular Tags |