01: //$Id: ComponentTuplizer.java 7451 2005-07-11 21:49:08Z steveebersole $
02: package org.hibernate.tuple.component;
03:
04: import java.io.Serializable;
05: import java.lang.reflect.Method;
06:
07: import org.hibernate.engine.SessionFactoryImplementor;
08: import org.hibernate.tuple.Tuplizer;
09:
10: /**
11: * Defines further responsibilities reagarding tuplization based on
12: * a mapped components.
13: * </p>
14: * ComponentTuplizer implementations should have the following constructor signature:
15: * (org.hibernate.mapping.Component)
16: *
17: * @author Gavin King
18: * @author Steve Ebersole
19: */
20: public interface ComponentTuplizer extends Tuplizer, Serializable {
21: /**
22: * Retreive the current value of the parent property.
23: *
24: * @param component The component instance from which to extract the parent
25: * property value.
26: * @return The current value of the parent property.
27: */
28: public Object getParent(Object component);
29:
30: /**
31: * Set the value of the parent property.
32: *
33: * @param component The component instance on which to set the parent.
34: * @param parent The parent to be set on the comonent.
35: * @param factory The current session factory.
36: */
37: public void setParent(Object component, Object parent,
38: SessionFactoryImplementor factory);
39:
40: /**
41: * Does the component managed by this tuuplizer contain a parent property?
42: *
43: * @return True if the component does contain a parent property; false otherwise.
44: */
45: public boolean hasParentProperty();
46:
47: /**
48: * Is the given method available via the managed component as a property getter?
49: *
50: * @param method The method which to check against the managed component.
51: * @return True if the managed component is available from the managed component; else false.
52: */
53: public boolean isMethodOf(Method method);
54: }
|