sf logo

sf.qof.mapping
Class AbstractBaseMapping

java.lang.Object
  extended by sf.qof.mapping.AbstractBaseMapping
All Implemented Interfaces:
Mapping, ParameterMapping, ResultMapping
Direct Known Subclasses:
AbstractCharacterMapping, AbstractDateTimeMapping, AbstractNumberMapping, AdapterMapping

public abstract class AbstractBaseMapping
extends Object
implements ParameterMapping, ResultMapping


Field Summary
protected  MappingAdapter adapter
           
protected  Class<?> beanType
           
protected  Class<?> collectionType
           
protected  Constructor<?> constructor
           
protected  Integer constructorParameter
           
protected  int index
           
protected  Class<?> mapKeyType
           
protected  Method method
           
protected  String[] sqlColumns
           
protected  int[] sqlIndexes
           
protected  Class<?> type
           
protected  boolean usesArray
           
 
Constructor Summary
AbstractBaseMapping()
           
 
Method Summary
 MappingAdapter getAdapter()
          Returns a custom mapping adapter.
 Class<?> getBeanType()
          Returns the type of the method parameter Java Bean or null.
 Class<?> getCollectionType()
          Returns the collection type of the method parameter or null.
 Constructor<?> getConstructor()
          Returns the constructor or null.
 Integer getConstructorParameter()
          Returns the index of a parameter in the constructor or null.
 Method getGetter()
          Returns the getter of the Java Bean or null.
 int getIndex()
          Returns the method parameter index.
 Class<?> getMapKeyType()
          Returns the type of the method return map key or null.
 Method getSetter()
          Returns the setter of the Java Bean or null.
 String[] getSqlColumns()
          Returns an array with the column names in the SQL statement.
 int[] getSqlIndexes()
          Returns an array with the indexes in the SQL statement.
 Class<?> getType()
          Returns mapping type.
 boolean isMapKey()
          True if mapping is a key for a Map.
 String parameterMappingInfo()
          Return info for parameter mapping.
 String resultMappingInfo()
          Return info for result mapping.
 void setParameters(Class<?> type, Class<?> collectionType, Class<?> beanType, Method setter, int[] sqlIndexes, String[] sqlColumns, MappingAdapter adapter, Class<?> mapKeyType, Integer constructorParameter, Constructor<?> constructor)
          Initializer.
 void setParameters(int index, Class<?> type, Class<?> collectionType, Class<?> beanType, Method getter, int[] sqlIndexes, String[] sqlColumns, MappingAdapter adapter, boolean usesArray)
          Initializer.
 boolean usesArray()
          True if the parameter is an array.
 boolean usesAtomic()
          True if the method parameter is either a primitive or an atomic value (like String).
 boolean usesCollection()
          True if the method parameter is a collection type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sf.qof.mapping.Mapping
accept
 

Field Detail

sqlIndexes

protected int[] sqlIndexes

sqlColumns

protected String[] sqlColumns

index

protected int index

type

protected Class<?> type

collectionType

protected Class<?> collectionType

mapKeyType

protected Class<?> mapKeyType

beanType

protected Class<?> beanType

method

protected Method method

adapter

protected MappingAdapter adapter

constructorParameter

protected Integer constructorParameter

constructor

protected Constructor<?> constructor

usesArray

protected boolean usesArray
Constructor Detail

AbstractBaseMapping

public AbstractBaseMapping()
Method Detail

setParameters

public void setParameters(int index,
                          Class<?> type,
                          Class<?> collectionType,
                          Class<?> beanType,
                          Method getter,
                          int[] sqlIndexes,
                          String[] sqlColumns,
                          MappingAdapter adapter,
                          boolean usesArray)
Description copied from interface: ParameterMapping
Initializer.

Specified by:
setParameters in interface ParameterMapping
Parameters:
index - method parameter index
type - mapping type
collectionType - collection type of method parameter
beanType - Java Bean object type of method parameter
getter - getter form Java Bean object
sqlIndexes - array of SQL indexes
sqlColumns - array of SQL column names
adapter - custom mapping adapter
usesArray - parameter is an array

setParameters

public void setParameters(Class<?> type,
                          Class<?> collectionType,
                          Class<?> beanType,
                          Method setter,
                          int[] sqlIndexes,
                          String[] sqlColumns,
                          MappingAdapter adapter,
                          Class<?> mapKeyType,
                          Integer constructorParameter,
                          Constructor<?> constructor)
Description copied from interface: ResultMapping
Initializer.

Specified by:
setParameters in interface ResultMapping
Parameters:
type - mapping type
collectionType - collection type of method return result
beanType - Java Bean object type of method return result
setter - setter form Java Bean object
sqlIndexes - array of SQL indexes
sqlColumns - array of SQL column names
adapter - custom mapping adapter
mapKeyType - map key type
constructorParameter - index of a parameter in the constructor
constructor - constructor

getBeanType

public Class<?> getBeanType()
Description copied from interface: ParameterMapping
Returns the type of the method parameter Java Bean or null.

Specified by:
getBeanType in interface ParameterMapping
Specified by:
getBeanType in interface ResultMapping
Returns:
bean type

getCollectionType

public Class<?> getCollectionType()
Description copied from interface: ParameterMapping
Returns the collection type of the method parameter or null. This needs to implement Collection.

Specified by:
getCollectionType in interface ParameterMapping
Specified by:
getCollectionType in interface ResultMapping
Returns:
collection type of the method parameter

getIndex

public int getIndex()
Description copied from interface: ParameterMapping
Returns the method parameter index.

Specified by:
getIndex in interface ParameterMapping
Returns:
method parameter index

getGetter

public Method getGetter()
Description copied from interface: ParameterMapping
Returns the getter of the Java Bean or null.

Specified by:
getGetter in interface ParameterMapping
Returns:
getter

getSetter

public Method getSetter()
Description copied from interface: ResultMapping
Returns the setter of the Java Bean or null.

Specified by:
getSetter in interface ResultMapping
Returns:
setter

getSqlColumns

public String[] getSqlColumns()
Description copied from interface: ParameterMapping
Returns an array with the column names in the SQL statement.

Specified by:
getSqlColumns in interface ParameterMapping
Specified by:
getSqlColumns in interface ResultMapping
Returns:
array of SQL column names

getSqlIndexes

public int[] getSqlIndexes()
Description copied from interface: ParameterMapping
Returns an array with the indexes in the SQL statement.

Specified by:
getSqlIndexes in interface ParameterMapping
Specified by:
getSqlIndexes in interface ResultMapping
Returns:
array of SQL indexes

getType

public Class<?> getType()
Description copied from interface: ParameterMapping
Returns mapping type.

Specified by:
getType in interface ParameterMapping
Specified by:
getType in interface ResultMapping
Returns:
mapping type

getAdapter

public MappingAdapter getAdapter()
Description copied from interface: ParameterMapping
Returns a custom mapping adapter.

Specified by:
getAdapter in interface ParameterMapping
Specified by:
getAdapter in interface ResultMapping
Returns:
mapping adapter

usesCollection

public boolean usesCollection()
Description copied from interface: ParameterMapping
True if the method parameter is a collection type.

Specified by:
usesCollection in interface ParameterMapping
Specified by:
usesCollection in interface ResultMapping
Returns:
uses collection type

usesAtomic

public boolean usesAtomic()
Description copied from interface: ParameterMapping
True if the method parameter is either a primitive or an atomic value (like String).

Specified by:
usesAtomic in interface ParameterMapping
Specified by:
usesAtomic in interface ResultMapping
Returns:
uses an atomic value

isMapKey

public boolean isMapKey()
Description copied from interface: ResultMapping
True if mapping is a key for a Map.

Specified by:
isMapKey in interface ResultMapping
Returns:
is a map key

getMapKeyType

public Class<?> getMapKeyType()
Description copied from interface: ResultMapping
Returns the type of the method return map key or null.

Specified by:
getMapKeyType in interface ResultMapping
Returns:
map key type

getConstructorParameter

public Integer getConstructorParameter()
Description copied from interface: ResultMapping
Returns the index of a parameter in the constructor or null.

Specified by:
getConstructorParameter in interface ResultMapping
Returns:
constructor parameter index

getConstructor

public Constructor<?> getConstructor()
Description copied from interface: ResultMapping
Returns the constructor or null.

Specified by:
getConstructor in interface ResultMapping
Returns:
constructor

usesArray

public boolean usesArray()
Description copied from interface: ParameterMapping
True if the parameter is an array.

Specified by:
usesArray in interface ParameterMapping
Returns:
uses an array

parameterMappingInfo

public String parameterMappingInfo()
Description copied from interface: Mapping
Return info for parameter mapping.

Specified by:
parameterMappingInfo in interface Mapping
Returns:
info

resultMappingInfo

public String resultMappingInfo()
Description copied from interface: Mapping
Return info for result mapping.

Specified by:
resultMappingInfo in interface Mapping
Returns:
info

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.