org.jbeanmapper.configurator
Class DefaultConfigurator

java.lang.Object
  extended byorg.jbeanmapper.configurator.DefaultConfigurator
All Implemented Interfaces:
Configurator

public class DefaultConfigurator
extends java.lang.Object
implements Configurator

Author:
Brian Pugh

Constructor Summary
DefaultConfigurator()
           
 
Method Summary
protected  PropertyMapping createPropertyMapping(java.beans.PropertyDescriptor srcPropertyDescriptor, java.beans.PropertyDescriptor targetPropertyDescriptor)
          Create a property mapping from srcPropertyDescriptor to targetPropertyDescriptor.
protected  org.apache.commons.digester.Digester getDigester()
          Get the digester for this configurator.
 BeanMapping getMapping(java.lang.Class clazz, java.lang.Class targetClass)
          Get a mapping from clazz to targetClass.
 java.util.List getMappings(org.xml.sax.InputSource inputSource)
          Get a list of mappings from an InputSource.
protected  java.util.List getPropertyMappings(java.lang.Class srcClass, java.lang.Class targetClass)
          Get the list of property mappings from srcClass to targetClass.
 boolean isValidating()
           
 void setValidating(boolean validating)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConfigurator

public DefaultConfigurator()
Method Detail

getMappings

public java.util.List getMappings(org.xml.sax.InputSource inputSource)
                           throws BeanMappingException
Description copied from interface: Configurator
Get a list of mappings from an InputSource.

Specified by:
getMappings in interface Configurator
Parameters:
inputSource - The source.
Returns:
A list of mappings from an InputSource.
Throws:
BeanMappingException - If the mapping is illegal or otherwise fails.

getDigester

protected org.apache.commons.digester.Digester getDigester()
                                                    throws org.xml.sax.SAXException
Get the digester for this configurator.

Returns:
The digester for this configurator.
Throws:
org.xml.sax.SAXException - If the configuration for the xml parser for the digester fails.

getMapping

public BeanMapping getMapping(java.lang.Class clazz,
                              java.lang.Class targetClass)
                       throws BeanMappingException
Description copied from interface: Configurator
Get a mapping from clazz to targetClass.

Specified by:
getMapping in interface Configurator
Parameters:
clazz - source class.
targetClass - target class.
Returns:
mapping from clazz to targetClass.
Throws:
BeanMappingException - If the mapping is illegal or otherwise fails.

getPropertyMappings

protected java.util.List getPropertyMappings(java.lang.Class srcClass,
                                             java.lang.Class targetClass)
                                      throws java.beans.IntrospectionException
Get the list of property mappings from srcClass to targetClass.

Parameters:
srcClass - The source class.
targetClass - The target class.
Returns:
The list of property mappings from srcClass to targetClass.
Throws:
java.beans.IntrospectionException - If introspection fails.

createPropertyMapping

protected PropertyMapping createPropertyMapping(java.beans.PropertyDescriptor srcPropertyDescriptor,
                                                java.beans.PropertyDescriptor targetPropertyDescriptor)
                                         throws java.beans.IntrospectionException
Create a property mapping from srcPropertyDescriptor to targetPropertyDescriptor.

Parameters:
srcPropertyDescriptor - The source property descriptor.
targetPropertyDescriptor - The target property descriptor.
Returns:
A property mapping from srcPropertyDescriptor to targetPropertyDescriptor.
Throws:
java.beans.IntrospectionException - If introspection fails.

isValidating

public boolean isValidating()
Returns:
true if this configurator validates its xml. false otherwise.

setValidating

public void setValidating(boolean validating)
Parameters:
validating - true to indicate that this configurator validates its xml. false otherwise.