01: // $Id: Instantiator.java 7449 2005-07-11 17:31:50Z steveebersole $
02: package org.hibernate.tuple;
03:
04: import java.io.Serializable;
05:
06: /**
07: * Contract for implementors responsible for instantiating entity/component instances.
08: *
09: * @author Steve Ebersole
10: */
11: public interface Instantiator extends Serializable {
12:
13: /**
14: * Perform the requested entity instantiation.
15: * <p/>
16: * This form is never called for component instantiation, only entity instantiation.
17: *
18: * @param id The id of the entity to be instantiated.
19: * @return An appropriately instantiated entity.
20: */
21: public Object instantiate(Serializable id);
22:
23: /**
24: * Perform the requested instantiation.
25: *
26: * @return The instantiated data structure.
27: */
28: public Object instantiate();
29:
30: /**
31: * Performs check to see if the given object is an instance of the entity
32: * or component which this Instantiator instantiates.
33: *
34: * @param object The object to be checked.
35: * @return True is the object does respresent an instance of the underlying
36: * entity/component.
37: */
38: public boolean isInstance(Object object);
39: }
|