1 package org.hibernate.tuple; 3 4 import org.dom4j.Element; 5 import org.hibernate.mapping.Component; 6 import org.hibernate.mapping.Property; 7 import org.hibernate.property.Getter; 8 import org.hibernate.property.PropertyAccessor; 9 import org.hibernate.property.PropertyAccessorFactory; 10 import org.hibernate.property.Setter; 11 12 15 public class Dom4jComponentTuplizer extends AbstractComponentTuplizer { 16 17 public Class getMappedClass() { 18 return Element.class; 19 } 20 21 public Dom4jComponentTuplizer(Component component) { 22 super(component); 23 } 24 25 protected Instantiator buildInstantiator(Component component) { 26 return new Dom4jInstantiator( component ); 27 } 28 29 private PropertyAccessor buildPropertyAccessor(Property property) { 30 return PropertyAccessorFactory.getDom4jPropertyAccessor( property.getNodeName(), property.getType(), null ); 33 } 34 35 protected Getter buildGetter(Component component, Property prop) { 36 return buildPropertyAccessor(prop).getGetter( null, prop.getName() ); 37 } 38 protected Setter buildSetter(Component component, Property prop) { 39 return buildPropertyAccessor(prop).getSetter( null, prop.getName() ); 40 } 41 42 } 43 | Popular Tags |