01: package com.bm.introspectors;
02:
03: import java.util.List;
04: import java.util.Set;
05:
06: /**
07: * This interface represents different introspectors like
08: * EntityBeanIntrospector.
09: *
10: * @author Daniel Wiese
11: * @param <T> -
12: * the type of the inspected class
13: * @since 07.10.2005
14: */
15: public interface Introspector<T> {
16:
17: /**
18: * This method returns informations about a peristent field.
19: *
20: * @param toCheck -
21: * the field to check
22: * @return - the information about the field
23: */
24: PersistentPropertyInfo getPresistentFieldInfo(Property toCheck);
25:
26: /**
27: * This method returns informations about a primary key field.
28: *
29: * @param toCheck -
30: * the field to check
31: * @return - the information about the field
32: */
33: PrimaryKeyInfo getPrimaryKeyInfo(Property toCheck);
34:
35: /**
36: * Returns the persistent fields.
37: *
38: * @return Returns the persitentFields.
39: */
40: List<Property> getPersitentProperties();
41:
42: /**
43: * Return the primary key fields.
44: *
45: * @return Returns the pkFields.
46: */
47: Set<Property> getPkFields();
48:
49: /**
50: * Returns a value of an field.
51: *
52: * @param instance -
53: * the instance
54: * @param toGet -
55: * the field to read the value
56: * @return - the readed value
57: * @throws IllegalAccessException -
58: * in error case
59: */
60: Object getField(T instance, Property toGet)
61: throws IllegalAccessException;
62:
63: /**
64: * Sets a value of an field.
65: *
66: * @param instance -
67: * the instance
68: * @param toSet -
69: * the field to set the value
70: * @param value -
71: * the new value
72: * @throws IllegalAccessException -
73: * in error case
74: */
75: void setField(T instance, Property toSet, Object value)
76: throws IllegalAccessException;
77:
78: }
|