1 5 package com.teamkonzept.field; 6 7 import com.teamkonzept.lib.*; 8 import com.teamkonzept.field.db.*; 9 10 public class TKFieldRegistry extends TKClassRegistry { 11 12 public void initObject( String classId, Object classObject, Object initData ) 13 throws 14 TKUnregisteredClassException, 15 ClassNotFoundException , 16 InstantiationException , 17 IllegalAccessException  18 { 19 TKBaseField field = (TKBaseField) classObject; 20 field.init( classId, initData ); 21 } 22 23 public static TKFieldRegistry registry = new TKFieldRegistry(); 24 25 public static final TKBaseField getFieldFromDB( TKFormDBData db, TKVector otherFields ) 26 throws 27 TKUnregisteredClassException, 28 ClassNotFoundException , 29 InstantiationException , 30 IllegalAccessException  31 { 32 String classId = ((TKFieldTableData) db.field.firstElement()).field_type; 33 TKBaseField field = (TKBaseField) registry.get( classId ); 34 35 field.initFromDB( classId, db, otherFields ); 36 return field; 37 } 38 39 public static final TKBaseField getFieldFromDB( TKFormDBData db ) 40 throws 41 TKUnregisteredClassException, 42 ClassNotFoundException , 43 InstantiationException , 44 IllegalAccessException  45 { 46 TKVector tmpFields = new TKVector(); 47 return getFieldFromDB( db, tmpFields ); 48 } 49 50 public static final TKBaseField getFieldFromData( Object fieldData ) 51 throws 52 TKUnregisteredClassException, 53 ClassNotFoundException , 54 InstantiationException , 55 IllegalAccessException  56 { 57 return getFieldFromData( TKFieldGroup.CLASS_ID, fieldData ); 58 } 59 60 public static final TKBaseField getFieldFromData( String classId, Object fieldData ) 61 throws 62 TKUnregisteredClassException, 63 ClassNotFoundException , 64 InstantiationException , 65 IllegalAccessException  66 { 67 return (TKBaseField) registry.get( classId, fieldData ); 68 } 69 70 71 } 72 73 74
| Popular Tags
|