FileDocCategorySizeDatePackage
Dom4jInstantiator.javaAPI DocHibernate 3.2.51455Mon Jul 11 12:31:50 BST 2005org.hibernate.tuple

Dom4jInstantiator

public class Dom4jInstantiator extends Object implements Instantiator
Performs "instantiation" based on DOM4J elements.

Fields Summary
private final String
nodeName
private final HashSet
isInstanceNodeNames
Constructors Summary
public Dom4jInstantiator(org.hibernate.mapping.Component component)


	   
		this.nodeName = component.getNodeName();
		isInstanceNodeNames.add( nodeName );
	
public Dom4jInstantiator(org.hibernate.mapping.PersistentClass mappingInfo)

		this.nodeName = mappingInfo.getNodeName();
		isInstanceNodeNames.add( nodeName );

		if ( mappingInfo.hasSubclasses() ) {
			Iterator itr = mappingInfo.getSubclassClosureIterator();
			while ( itr.hasNext() ) {
				final PersistentClass subclassInfo = ( PersistentClass ) itr.next();
				isInstanceNodeNames.add( subclassInfo.getNodeName() );
			}
		}
	
Methods Summary
public java.lang.Objectinstantiate(java.io.Serializable id)

		return instantiate();
	
public java.lang.Objectinstantiate()

		return XMLHelper.generateDom4jElement( nodeName );
	
public booleanisInstance(java.lang.Object object)

		if ( object instanceof Element ) {
			return isInstanceNodeNames.contains( ( ( Element ) object ).getName() );
		}
		else {
			return false;
		}