org.jbeanmapper.configurator
Class BeanMappingRule

java.lang.Object
  extended byorg.apache.commons.digester.Rule
      extended byorg.jbeanmapper.configurator.BeanMappingRule

public class BeanMappingRule
extends org.apache.commons.digester.Rule

Digester rule for handling <bean-mapping> elements.

Author:
Brian Pugh

Field Summary
 
Fields inherited from class org.apache.commons.digester.Rule
digester, namespaceURI
 
Constructor Summary
BeanMappingRule()
           
 
Method Summary
 void begin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes)
          Process the <bean-mapping> element.
 void end(java.lang.String namespace, java.lang.String name)
          Complete processing of the <bean-mapping> element.
protected  java.lang.Class getBeanClass(java.lang.String bean)
          Get the class for the bean.
protected  BeanCreator instantiate(java.lang.String bean)
          Create an instantance of the class with the name bean.
 
Methods inherited from class org.apache.commons.digester.Rule
begin, body, body, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanMappingRule

public BeanMappingRule()
Method Detail

begin

public void begin(java.lang.String namespace,
                  java.lang.String name,
                  org.xml.sax.Attributes attributes)
           throws java.lang.Exception
Process the <bean-mapping> element.

Parameters:
namespace - the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
name - the local name if the parser is namespace aware, or just the element name otherwise
attributes - The attribute list of this element
Throws:
java.lang.Exception - if the rule cannot be processed.

getBeanClass

protected java.lang.Class getBeanClass(java.lang.String bean)
                                throws BeanMappingException
Get the class for the bean.

Parameters:
bean - The bean for which the class should be found.
Returns:
The class for the bean.
Throws:
BeanMappingException - if the class cannot be located

instantiate

protected BeanCreator instantiate(java.lang.String bean)
                           throws BeanMappingException
Create an instantance of the class with the name bean.

Parameters:
bean - type of instance to create.
Returns:
an instantance of bean
Throws:
BeanMappingException - if bean couldn't be instantiated.

end

public void end(java.lang.String namespace,
                java.lang.String name)
         throws java.lang.Exception
Complete processing of the <bean-mapping> element.

Parameters:
namespace - the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
name - the local name if the parser is namespace aware, or just the element name otherwise
Throws:
java.lang.Exception - if the rule cannot be processed.