org.kuali.student.common.assembly.transform
Class DefaultDataBeanMapper

java.lang.Object
  extended by org.kuali.student.common.assembly.transform.DefaultDataBeanMapper
All Implemented Interfaces:
DataBeanMapper

public class DefaultDataBeanMapper
extends Object
implements DataBeanMapper


Field Summary
static DataBeanMapper INSTANCE
           
 
Constructor Summary
DefaultDataBeanMapper()
           
 
Method Summary
 Data convertFromBean(Object value)
          Takes a DTO Bean and converts it to a Data map structure.
 Object convertFromData(Data data, Class<?> clazz, Metadata metadata)
          Takes a data map and converts it to the corresponding DTO Bean
protected  Object convertNestedData(Data data, Field propField, Metadata metadata)
          Processes a nested data map, it checks to see if the data should be converted to a list structure or simply be processed as a nested complex object structure.
protected  Data getCollectionData(Object value)
          Returns a data map object representing a collection
protected  boolean isPropertyValid(Object value)
           
protected  void setDataAttributes(Data data, Object value)
          This process the attributes map and sets the attribute key/value pairs into the Data map
protected  void setDataListValue(Data data, Object value)
          Used to set a list item value into the data object.
protected  void setDataValue(Data data, String propertyKey, Object value)
          Used to set a simple property value into the data object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static DataBeanMapper INSTANCE
Constructor Detail

DefaultDataBeanMapper

public DefaultDataBeanMapper()
Method Detail

convertFromBean

public Data convertFromBean(Object value)
                     throws Exception
Description copied from interface: DataBeanMapper
Takes a DTO Bean and converts it to a Data map structure.

Specified by:
convertFromBean in interface DataBeanMapper
Returns:
the converted bean object
Throws:
Exception

convertFromData

public Object convertFromData(Data data,
                              Class<?> clazz,
                              Metadata metadata)
                       throws Exception
Description copied from interface: DataBeanMapper
Takes a data map and converts it to the corresponding DTO Bean

Specified by:
convertFromData in interface DataBeanMapper
Returns:
Throws:
Exception

convertNestedData

protected Object convertNestedData(Data data,
                                   Field propField,
                                   Metadata metadata)
                            throws Exception
Processes a nested data map, it checks to see if the data should be converted to a list structure or simply be processed as a nested complex object structure.

Parameters:
data -
propField -
Returns:
Throws:
Exception

setDataValue

protected void setDataValue(Data data,
                            String propertyKey,
                            Object value)
                     throws Exception
Used to set a simple property value into the data object.

Parameters:
data -
propertyKey -
value -
Throws:
Exception

setDataAttributes

protected void setDataAttributes(Data data,
                                 Object value)
This process the attributes map and sets the attribute key/value pairs into the Data map

Parameters:
data -
value -

setDataListValue

protected void setDataListValue(Data data,
                                Object value)
                         throws Exception
Used to set a list item value into the data object.

Parameters:
data -
value -
Throws:
Exception

getCollectionData

protected Data getCollectionData(Object value)
                          throws Exception
Returns a data map object representing a collection

Parameters:
value -
Returns:
Throws:
Exception

isPropertyValid

protected boolean isPropertyValid(Object value)


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.