1 5 package xdoclet.modules.jdo; 6 7 import java.util.Collection ; 8 import xjavadoc.XClass; 9 import xjavadoc.XConstructor; 10 import xjavadoc.XField; 11 import xjavadoc.XMethod; 12 import xjavadoc.XPackage; 13 import xdoclet.SubTask; 14 import xdoclet.XDocletException; 15 16 21 public abstract class VendorExtensionsSubTask extends SubTask 22 { 23 24 public final static String SQL_TABLE_TAG = "sql.table"; 26 public final static String SQL_FIELD_TAG = "sql.field"; 27 public final static String TABLE_NAME_ATTR = "table-name"; 28 public final static String COLUMN_NAME_ATTR = "column-name"; 29 public final static String RELATED_FIELD_ATTR = "related-field"; 30 31 public final static String SQL_RELATION_TAG = "sql.relation"; 32 public final static String STYLE_ATTR = "style"; 33 public final static String STYLE_FOREIGN_KEY_VALUE = "foreign-key"; 34 public final static String STYLE_RELATION_TABLE_VALUE = "relation-table"; 35 36 39 40 public abstract String getVendorName(); 41 42 public abstract String getVendorDescription(); 43 44 46 52 public XClass getCurrentClass() 53 { 54 return getMetadataSubTask().getCurrentClass(); 55 } 56 57 63 public XPackage getCurrentPackage() 64 { 65 return getMetadataSubTask().getCurrentPackage(); 66 } 67 68 74 public XMethod getCurrentMethod() 75 { 76 return getMetadataSubTask().getCurrentMethod(); 77 } 78 79 85 public XConstructor getCurrentConstructor() 86 { 87 return getMetadataSubTask().getCurrentConstructor(); 88 } 89 90 96 public XField getCurrentField() 97 { 98 return getMetadataSubTask().getCurrentField(); 99 } 100 101 108 public void setCurrentPackage(XPackage pakkage) 109 { 110 getMetadataSubTask().setCurrentPackage(pakkage); 111 } 112 113 119 public void setCurrentMethod(XMethod method) 120 { 121 getMetadataSubTask().setCurrentMethod(method); 122 } 123 124 130 public void setCurrentConstructor(XConstructor constructor) 131 { 132 getMetadataSubTask().setCurrentConstructor(constructor); 133 } 134 135 141 public void setCurrentField(XField field) 142 { 143 getMetadataSubTask().setCurrentField(field); 144 } 145 146 153 public void setCurrentClass(XClass clazz) 154 { 155 getMetadataSubTask().setCurrentClass(clazz); 156 } 157 158 167 public XClass pushCurrentClass(XClass clazz) 168 { 169 return getMetadataSubTask().pushCurrentClass(clazz); 170 } 171 172 180 public XClass popCurrentClass() 181 { 182 return getMetadataSubTask().popCurrentClass(); 183 } 184 185 189 public void execute() throws XDocletException 190 { 191 } 193 194 protected JdoXmlMetadataSubTask getMetadataSubTask() 195 { 196 return (JdoXmlMetadataSubTask) getContext().getSubTaskBy("jdometadata"); 197 } 198 199 protected Collection getExtensions(String level) throws XDocletException 200 { 201 if ("class".equals(level)) 202 return getClassExtensions(); 203 else if ("field".equals(level)) 204 return getFieldExtensions(); 205 else if ("collection".equals(level)) 206 return getCollectionExtensions(); 207 else if ("array".equals(level)) 208 return getArrayExtensions(); 209 else if ("map".equals(level)) 210 return getMapExtensions(); 211 else 212 return null; 213 } 214 215 protected abstract Collection getClassExtensions() throws XDocletException; 216 217 protected abstract Collection getFieldExtensions() throws XDocletException; 218 219 protected abstract Collection getCollectionExtensions() throws XDocletException; 220 221 protected abstract Collection getArrayExtensions() throws XDocletException; 222 223 protected abstract Collection getMapExtensions() throws XDocletException; 224 } 225 | Popular Tags |