01: /*
02: * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/field/TKFieldRegistry.java,v 1.5 2000/05/22 15:01:09 careck Exp $
03: *
04: */
05: package com.teamkonzept.field;
06:
07: import com.teamkonzept.lib.*;
08: import com.teamkonzept.field.db.*;
09:
10: public class TKFieldRegistry extends TKClassRegistry {
11:
12: public void initObject(String classId, Object classObject,
13: Object initData) throws TKUnregisteredClassException,
14: ClassNotFoundException, InstantiationException,
15: IllegalAccessException {
16: TKBaseField field = (TKBaseField) classObject;
17: field.init(classId, initData);
18: }
19:
20: public static TKFieldRegistry registry = new TKFieldRegistry();
21:
22: public static final TKBaseField getFieldFromDB(TKFormDBData db,
23: TKVector otherFields) throws TKUnregisteredClassException,
24: ClassNotFoundException, InstantiationException,
25: IllegalAccessException {
26: String classId = ((TKFieldTableData) db.field.firstElement()).field_type;
27: TKBaseField field = (TKBaseField) registry.get(classId);
28:
29: field.initFromDB(classId, db, otherFields);
30: return field;
31: }
32:
33: public static final TKBaseField getFieldFromDB(TKFormDBData db)
34: throws TKUnregisteredClassException,
35: ClassNotFoundException, InstantiationException,
36: IllegalAccessException {
37: TKVector tmpFields = new TKVector();
38: return getFieldFromDB(db, tmpFields);
39: }
40:
41: public static final TKBaseField getFieldFromData(Object fieldData)
42: throws TKUnregisteredClassException,
43: ClassNotFoundException, InstantiationException,
44: IllegalAccessException {
45: return getFieldFromData(TKFieldGroup.CLASS_ID, fieldData);
46: }
47:
48: public static final TKBaseField getFieldFromData(String classId,
49: Object fieldData) throws TKUnregisteredClassException,
50: ClassNotFoundException, InstantiationException,
51: IllegalAccessException {
52: return (TKBaseField) registry.get(classId, fieldData);
53: }
54:
55: }
|