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
           
(package private)  Logger LOG
           
 
Constructor Summary
DefaultDataBeanMapper()
           
 
Method Summary
protected  String convertDataValueToStringValue(Data data)
          Converts a list represented by DataValue to a list of values as a comma delimited StringValue
 Data convertFromBean(Object value, Metadata metadata)
          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 convertStringToDataValue(String stringValue)
          Converts a list represented by a comma delimited string so to a DataValue
protected  Data getCollectionData(Object value, Metadata metadata)
          Returns a data map object representing a collection
protected  boolean isPropertyValid(Object value)
           
protected  void setDataAttributes(Data data, Object value, Metadata metadata)
          This process the attributes map and sets the attribute key/value pairs into the Data map
protected  void setDataListValue(Data data, Object value, Metadata metadata)
          Used to set a list item value into the data object.
protected  void setDataValue(Data data, String propertyKey, Object value, Metadata metadata)
          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

LOG

final Logger LOG
Constructor Detail

DefaultDataBeanMapper

public DefaultDataBeanMapper()
Method Detail

convertFromBean

public Data convertFromBean(Object value,
                            Metadata metadata)
                     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
Parameters:
value - The DTO Bean to convert to data map
metadata - Metadata describing the dto bean
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,
                            Metadata metadata)
                     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,
                                 Metadata metadata)
This process the attributes map and sets the attribute key/value pairs into the Data map

Parameters:
data -
value -

convertStringToDataValue

protected Data convertStringToDataValue(String stringValue)
Converts a list represented by a comma delimited string so to a DataValue

Parameters:
stringValue - a comma separated list of values
Returns:
DataValue representation of stringValue

convertDataValueToStringValue

protected String convertDataValueToStringValue(Data data)
Converts a list represented by DataValue to a list of values as a comma delimited StringValue

Parameters:
dataValue - DataValue representing a list object
Returns:
the list converted to a comma delimited StringValue

setDataListValue

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

Parameters:
data -
value -
Throws:
Exception

getCollectionData

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

Parameters:
value -
Returns:
Throws:
Exception

isPropertyValid

protected boolean isPropertyValid(Object value)


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