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 QuoteDescriptor 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 QuoteDescriptor() { 50 super(); 51 nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"; 52 xmlName = "quote"; 53 XMLFieldDescriptorImpl desc = null; 54 XMLFieldHandler handler = null; 55 FieldValidator fieldValidator = null; 56 58 60 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_author", "author", NodeType.Element); 62 desc.setImmutable(true); 63 handler = (new XMLFieldHandler() { 64 public Object getValue( Object object ) 65 throws IllegalStateException 66 { 67 Quote target = (Quote) object; 68 return target.getAuthor(); 69 } 70 public void setValue( Object object, Object value) 71 throws IllegalStateException , IllegalArgumentException 72 { 73 try { 74 Quote target = (Quote) object; 75 target.setAuthor( (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.setRequired(true); 88 desc.setMultivalued(false); 89 addFieldDescriptor(desc); 90 91 fieldValidator = new FieldValidator(); 93 fieldValidator.setMinOccurs(1); 94 { StringValidator sv = new StringValidator(); 96 sv.setWhiteSpace("preserve"); 97 fieldValidator.setValidator(sv); 98 } 99 desc.setValidator(fieldValidator); 100 101 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_link", "link", NodeType.Element); 103 desc.setImmutable(true); 104 handler = (new XMLFieldHandler() { 105 public Object getValue( Object object ) 106 throws IllegalStateException 107 { 108 Quote target = (Quote) object; 109 return target.getLink(); 110 } 111 public void setValue( Object object, Object value) 112 throws IllegalStateException , IllegalArgumentException 113 { 114 try { 115 Quote target = (Quote) object; 116 target.setLink( (java.lang.String ) value); 117 } 118 catch (Exception ex) { 119 throw new IllegalStateException (ex.toString()); 120 } 121 } 122 public Object newInstance( Object parent ) { 123 return null; 124 } 125 } ); 126 desc.setHandler(handler); 127 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 128 desc.setMultivalued(false); 129 addFieldDescriptor(desc); 130 131 fieldValidator = new FieldValidator(); 133 { StringValidator sv = new StringValidator(); 135 sv.setWhiteSpace("preserve"); 136 fieldValidator.setValidator(sv); 137 } 138 desc.setValidator(fieldValidator); 139 140 desc = new XMLFieldDescriptorImpl(java.lang.String .class, "_p", "p", NodeType.Element); 142 desc.setImmutable(true); 143 handler = (new XMLFieldHandler() { 144 public Object getValue( Object object ) 145 throws IllegalStateException 146 { 147 Quote target = (Quote) object; 148 return target.getP(); 149 } 150 public void setValue( Object object, Object value) 151 throws IllegalStateException , IllegalArgumentException 152 { 153 try { 154 Quote target = (Quote) object; 155 target.setP( (java.lang.String ) value); 156 } 157 catch (Exception ex) { 158 throw new IllegalStateException (ex.toString()); 159 } 160 } 161 public Object newInstance( Object parent ) { 162 return null; 163 } 164 } ); 165 desc.setHandler(handler); 166 desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content"); 167 desc.setRequired(true); 168 desc.setMultivalued(false); 169 addFieldDescriptor(desc); 170 171 fieldValidator = new FieldValidator(); 173 fieldValidator.setMinOccurs(1); 174 { StringValidator sv = new StringValidator(); 176 sv.setWhiteSpace("preserve"); 177 fieldValidator.setValidator(sv); 178 } 179 desc.setValidator(fieldValidator); 180 181 } 183 184 188 190 public org.exolab.castor.mapping.AccessMode getAccessMode() 191 { 192 return null; 193 } 195 197 public org.exolab.castor.mapping.ClassDescriptor getExtends() 198 { 199 return null; 200 } 202 204 public org.exolab.castor.mapping.FieldDescriptor getIdentity() 205 { 206 return identity; 207 } 209 211 public java.lang.Class getJavaClass() 212 { 213 return org.apache.jetspeed.xml.api.jcm.Quote.class; 214 } 216 218 public java.lang.String getNameSpacePrefix() 219 { 220 return nsPrefix; 221 } 223 225 public java.lang.String getNameSpaceURI() 226 { 227 return nsURI; 228 } 230 232 public org.exolab.castor.xml.TypeValidator getValidator() 233 { 234 return this; 235 } 237 239 public java.lang.String getXMLName() 240 { 241 return xmlName; 242 } 244 } 245 | Popular Tags |