private static AccessInfo getAccessInfo ( StorableProperty property , int dataType , String dataTypeName , int columnSize , int decimalDigits ) { AccessInfo info = getAccessInfo ( property . getType ( ) , dataType , dataTypeName , columnSize , decimalDigits ) ; if ( info != null ) { return info ; } // Dynamically typed data sources (e.g. SQLite3) always report // dataType as java.sql.Types.VARCHAR. Infer the dataType from the // dataTypeName and try again. if ( dataType == java . sql . Types . VARCHAR ) { Integer dataTypeMapping = typeNameToDataTypeMapping . get ( dataTypeName . toUpperCase ( ) ) ; if ( dataTypeMapping != null ) { info = getAccessInfo ( property . getType ( ) , dataTypeMapping , dataTypeName , columnSize , decimalDigits ) ; if ( info != null ) { return info ; } } } // See if an appropriate adapter exists. StorablePropertyAdapter adapter = property . getAdapter ( ) ; if ( adapter != null ) { Method [ ] toMethods = adapter . findAdaptMethodsTo ( property . getType ( ) ) ; for ( Method toMethod : toMethods ) { Class fromType = toMethod . getParameterTypes ( ) [ 0 ] ; // Verify that reverse adapt method exists as well... if ( adapter . findAdaptMethod ( property . getType ( ) , fromType ) != null ) { // ...and try to get access info for fromType. info = getAccessInfo ( fromType , dataType , dataTypeName , columnSize , decimalDigits ) ; if ( info != null ) { info . setAdapter ( adapter ) ; return info ; } } } } return null ; }
Figures out how to best access the given property or returns null if not supported . An adapter may be applied .