FileDocCategorySizeDatePackage
Dom4jAccessor.javaAPI DocHibernate 3.2.59254Thu Sep 01 13:49:40 BST 2005org.hibernate.property

Dom4jAccessor

public class Dom4jAccessor extends Object implements PropertyAccessor
Responsible for accessing property values represented as a dom4j Element or Attribute.
author
Steve Ebersole

Fields Summary
private String
nodeName
private org.hibernate.type.Type
propertyType
private final org.hibernate.engine.SessionFactoryImplementor
factory
Constructors Summary
public Dom4jAccessor(String nodeName, org.hibernate.type.Type propertyType, org.hibernate.engine.SessionFactoryImplementor factory)

		this.factory = factory;
		this.nodeName = nodeName;
		this.propertyType = propertyType;
		
	
Methods Summary
public GettergetGetter(java.lang.Class theClass, java.lang.String propertyName)
Create a "getter" for the named attribute

		if (nodeName==null) {
			throw new MappingException("no node name for property: " + propertyName);
		}
		if ( ".".equals(nodeName) ) {
			return new TextGetter(propertyType, factory);
		}
		else if ( nodeName.indexOf('/")>-1 ) {
			return new ElementAttributeGetter(nodeName, propertyType, factory);
		}
		else if ( nodeName.indexOf('@")>-1 ) {
			return new AttributeGetter(nodeName, propertyType, factory);
		}
		else {
			return new ElementGetter(nodeName, propertyType, factory);
		}
	
public SettergetSetter(java.lang.Class theClass, java.lang.String propertyName)
Create a "setter" for the named attribute

		if (nodeName==null) {
			throw new MappingException("no node name for property: " + propertyName);
		}
		if ( ".".equals(nodeName) ) {
			return new TextSetter(propertyType);
		}
		else if ( nodeName.indexOf('/")>-1 ) {
			return new ElementAttributeSetter(nodeName, propertyType);
		}
		else if ( nodeName.indexOf('@")>-1 ) {
			return new AttributeSetter(nodeName, propertyType);
		}
		else {
			return new ElementSetter(nodeName, propertyType);
		}