KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > tuple > DynamicMapComponentTuplizer


1 //$Id: DynamicMapComponentTuplizer.java,v 1.2 2005/07/11 17:31:50 steveebersole Exp $
2
package org.hibernate.tuple;
3
4 import java.util.Map JavaDoc;
5
6 import org.hibernate.mapping.Component;
7 import org.hibernate.mapping.Property;
8 import org.hibernate.property.Getter;
9 import org.hibernate.property.PropertyAccessor;
10 import org.hibernate.property.PropertyAccessorFactory;
11 import org.hibernate.property.Setter;
12
13 /**
14  * @author Gavin King
15  */

16 public class DynamicMapComponentTuplizer extends AbstractComponentTuplizer {
17     
18     public Class JavaDoc getMappedClass() {
19         return Map JavaDoc.class;
20     }
21     
22     protected Instantiator buildInstantiator(Component component) {
23         return new DynamicMapInstantiator();
24     }
25     
26     public DynamicMapComponentTuplizer(Component component) {
27         super(component);
28     }
29
30     private PropertyAccessor buildPropertyAccessor(Property property) {
31         return PropertyAccessorFactory.getDynamicMapPropertyAccessor();
32     }
33
34     protected Getter buildGetter(Component component, Property prop) {
35         return buildPropertyAccessor(prop).getGetter( null, prop.getName() );
36     }
37
38     protected Setter buildSetter(Component component, Property prop) {
39         return buildPropertyAccessor(prop).getSetter( null, prop.getName() );
40     }
41
42 }
43
Popular Tags