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 TopicsDescriptor 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 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 58 60 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 fieldValidator = new FieldValidator(); 92 fieldValidator.setMinOccurs(1); 93 desc.setValidator(fieldValidator); 94 95 } 97 98 102 104 public org.exolab.castor.mapping.AccessMode getAccessMode() 105 { 106 return null; 107 } 109 111 public org.exolab.castor.mapping.ClassDescriptor getExtends() 112 { 113 return null; 114 } 116 118 public org.exolab.castor.mapping.FieldDescriptor getIdentity() 119 { 120 return identity; 121 } 123 125 public java.lang.Class getJavaClass() 126 { 127 return org.apache.jetspeed.xml.api.jcm.Topics.class; 128 } 130 132 public java.lang.String getNameSpacePrefix() 133 { 134 return nsPrefix; 135 } 137 139 public java.lang.String getNameSpaceURI() 140 { 141 return nsURI; 142 } 144 146 public org.exolab.castor.xml.TypeValidator getValidator() 147 { 148 return this; 149 } 151 153 public java.lang.String getXMLName() 154 { 155 return xmlName; 156 } 158 } 159 | Popular Tags |