1 23 24 package com.sun.jdo.api.persistence.model; 25 26 import java.util.List ; 27 import java.net.URL ; 28 import java.io.IOException ; 29 import java.io.BufferedInputStream ; 30 import java.io.BufferedOutputStream ; 31 import java.io.InputStream ; 32 import java.lang.reflect.Modifier ; 33 34 import com.sun.jdo.api.persistence.model.jdo.PersistenceClassElement; 35 import com.sun.jdo.api.persistence.model.jdo.PersistenceFieldElement; 36 37 42 class EnhancerModel extends Model { 43 private static final boolean DEBUG = false; 44 45 52 EnhancerModel () { 53 super(); 54 } 55 56 62 public boolean isInterface (String className) { 63 throw new UnsupportedOperationException (); 64 } 65 66 78 protected BufferedInputStream getInputStreamForResource (String className, 79 ClassLoader classLoader, String resourceName) 80 { 81 debug("getInputStreamForResource(" + className + "," + resourceName + ")"); 84 InputStream is = (classLoader != null) 85 ? classLoader.getResourceAsStream(resourceName) 86 : ClassLoader.getSystemResourceAsStream(resourceName); 87 88 BufferedInputStream rc = null; 89 if (is != null && !(is instanceof BufferedInputStream )) { 90 rc = new BufferedInputStream (is); 91 } else { 92 rc = (BufferedInputStream )is; 93 } 94 return rc; 95 } 96 97 104 protected String findPenultimateSuperclass (String className) { 105 debug("findPenultimateSuperclass(" + className + ")"); throw new UnsupportedOperationException (); 107 } 108 109 115 protected String getSuperclass (String className) { 116 debug("getSuperclass (" + className + ")"); return null; } 119 120 133 protected BufferedOutputStream createFile (String className, String baseFileName, 134 String extension) throws IOException 135 { 136 throw new UnsupportedOperationException (); 137 } 138 139 146 protected void deleteFile (String className, String fileName) 147 throws IOException 148 { 149 throw new UnsupportedOperationException (); 150 } 151 152 157 public Object getClass (String className, ClassLoader classLoader) 158 { 159 throw new UnsupportedOperationException (); 160 } 161 162 172 public boolean implementsInterface (Object classElement, 173 String interfaceName) 174 { 175 throw new UnsupportedOperationException (); 176 } 177 178 184 public boolean hasConstructor (String className) 185 { 186 throw new UnsupportedOperationException (); 187 } 188 189 199 public Object getConstructor (String className, String [] argTypeNames) 200 { 201 throw new UnsupportedOperationException (); 202 } 203 204 215 public Object getMethod (String className, String methodName, 216 String [] argTypeNames) 217 { 218 throw new UnsupportedOperationException (); 219 } 220 221 232 public String getType (Object element) 233 { 234 throw new UnsupportedOperationException (); 235 } 236 237 243 public List getFields (String className) { 244 throw new UnsupportedOperationException (); 245 } 246 247 255 public Object getField (String className, String fieldName) { 256 throw new UnsupportedOperationException (); 257 } 258 259 270 public boolean isSerializable (Object fieldElement) 271 { 272 throw new UnsupportedOperationException (); 273 } 274 275 285 public boolean isArray (String className, String fieldName) { 286 throw new UnsupportedOperationException (); 287 } 288 289 303 public String getDeclaringClass (Object memberElement) 304 { 305 throw new UnsupportedOperationException (); 306 } 307 308 321 public int getModifiers (Object memberElement) 322 { 323 throw new UnsupportedOperationException (); 324 } 325 326 335 public PersistenceFieldElement getPersistenceField(String className, 336 String fieldName) 337 { 338 return getPersistenceFieldInternal(className, fieldName); 339 } 340 341 350 public boolean isKey (String className, String fieldName) 351 { 352 PersistenceFieldElement field = 353 getPersistenceField(className, fieldName); 354 355 return field != null ? field.isKey() : false; 356 } 357 358 private void debug (Object o) { 359 if (DEBUG) 360 System.out.println("EnhancerModel::" + o); } 362 } 363 | Popular Tags |