signature:
public class RecordMapper { /** * Extract the values for all columns in the current row .
 * < p > Utilizes public setters and result set metadata .
 * @ see java . sql . ResultSetMetaData */
@ Override public T mapRow ( ResultSet rs , int rowNumber ) throws SQLException { } }

implementation: Assert . state ( this . mappedClass != null , "Mapped class was not specified" ) ; T mappedObject ; try { mappedObject = mappedClass . newInstance ( ) ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } ResultSetMetaData rsmd = rs . getMetaData ( ) ; int columnCount = rsmd . getColumnCount ( ) ; for ( int index = 1 ; index <= columnCount ; index ++ ) { String column = JdbcUtils . lookupColumnName ( rsmd , index ) ; Field field = this . mappedFields . get ( column . replaceAll ( " " , "" ) ) ; if ( field != null ) { Object value = getColumnValue ( rs , index , field ) ; if ( logger . isTraceEnabled ( ) && rowNumber == 0 ) { logger . trace ( "Mapping column '" + column + "' to property '" + field . getName ( ) + "' of type " + field . getType ( ) ) ; } try { field . set ( mappedObject , value ) ; } catch ( IllegalArgumentException e ) { if ( value == null && primitivesDefaultedForNullValue ) { logger . debug ( "Intercepted IllegalArgumentException for row " + rowNumber + " and column '" + column + "' with value " + value + " when setting property '" + field . getName ( ) + "' of type " + field . getType ( ) + " on object: " + mappedObject ) ; } else { throw e ; } } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } } } return mappedObject ;


signature:
public class RecordMapper { /** * Static factory method to create a new RecordMapper
 * ( with the mapped class specified only once ) .
 * @ param mappedClass the class that each row should be mapped to */
public static < T > RecordMapper < T > newInstance ( Class < T > mappedClass ) { } }

implementation: RecordMapper < T > newInstance = new RecordMapper < T > ( ) ; newInstance . setMappedClass ( mappedClass ) ; return newInstance ;


signature:
public class ResourceSelection { /** * 根据类别生成默认的名称 。
 * @ param catalog
 * 类别
 * @ return 名称 */
public static String generateName ( final String catalog ) { } }

implementation: String [ ] catalogs = catalog . split ( "/" ) ; return catalogs [ catalogs . length - 1 ] ;


signature:
public class CodedMessages { /** * 新建跟踪级别的消息 。
 * @ param code
 * 编码
 * @ param arguments
 * 参数列表
 * @ return 新建的消息 */
public static CodedMessage trace ( final String code , final String ... arguments ) { } }

implementation: return new CodedMessage ( code , CodedMessageLevel . TRACE , arguments ) ;


signature:
public class CodedMessages { /** * 新建调试级别的消息 。
 * @ param code
 * 编码
 * @ param arguments
 * 参数列表
 * @ return 新建的消息 */
public static CodedMessage debug ( final String code , final String ... arguments ) { } }

implementation: return new CodedMessage ( code , CodedMessageLevel . DEBUG , arguments ) ;


signature:
public class CodedMessages { /** * 新建消息级别的消息 。
 * @ param code
 * 编码
 * @ param arguments
 * 参数列表
 * @ return 新建的消息 */
public static CodedMessage information ( final String code , final String ... arguments ) { } }

implementation: return new CodedMessage ( code , CodedMessageLevel . INFORMATION , arguments ) ;


signature:
public class CodedMessages { /** * 新建警告级别的消息 。
 * @ param code
 * 编码
 * @ param arguments
 * 参数列表
 * @ return 新建的消息 */
public static CodedMessage warning ( final String code , final String ... arguments ) { } }

implementation: return new CodedMessage ( code , CodedMessageLevel . WARNING , arguments ) ;


signature:
public class CodedMessages { /** * 新建错误级别的消息 。
 * @ param code
 * 编码
 * @ param arguments
 * 参数列表
 * @ return 新建的消息 */
public static CodedMessage error ( final String code , final String ... arguments ) { } }

implementation: return new CodedMessage ( code , CodedMessageLevel . ERROR , arguments ) ;


signature:
public class CodedMessages { /** * 新建致命错误级别的消息 。
 * @ param code
 * 编码
 * @ param arguments
 * 参数列表
 * @ return 新建的消息 */
public static CodedMessage fatal ( final String code , final String ... arguments ) { } }

implementation: return new CodedMessage ( code , CodedMessageLevel . FATAL , arguments ) ;


signature:
public class CodedMessages { /** * 从文件加载 。
 * @ param reader
 * 输入流
 * @ return 消息记录组
 * @ throws CodedMessageException
 * 操作异常 */
public static List < CodedMessage > load ( final Reader reader ) throws CodedMessageException { } }

implementation: Document document ; try { Transformer transformer = TRANSFORMER_FACTORY . newTransformer ( ) ; DOMResult result = new DOMResult ( ) ; transformer . transform ( new StreamSource ( reader ) , result ) ; document = ( Document ) result . getNode ( ) ; } catch ( TransformerException e ) { throw new CodedMessageException ( e , "CodedMessage.LoadXMLError" ) ; } return load0 ( document . getDocumentElement ( ) ) ;


signature:
public class CodedMessages { /** * 保存到文件 。
 * @ param messageList
 * 消息记录组
 * @ param writer
 * 输出流
 * @ throws CodedMessageException
 * 操作异常 */
public static void save ( final List < CodedMessage > messageList , final OutputStream writer ) throws CodedMessageException { } }

implementation: try { Document document = save0 ( messageList ) ; Transformer transformer = TRANSFORMER_FACTORY . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . ENCODING , "UTF-8" ) ; transformer . transform ( new DOMSource ( document ) , new StreamResult ( writer ) ) ; } catch ( TransformerException e ) { throw new CodedMessageException ( e , "CodedMessage.SaveXMLError" ) ; }


signature:
public class FilterPattern { /** * Returns a new instance of FilterPattern , using the passed in arguments . */
public static FilterPattern newInstance ( EnumSet < DispatcherType > dispatcherTypes , boolean matchAfter , Iterable < String > patterns ) { } }

implementation: return new FilterPattern ( dispatcherTypes , matchAfter , ImmutableList . copyOf ( patterns ) ) ;


signature:
public class FilterPattern { /** * Returns a new intance of FitlerPattern using default values and the patterns passed in .
 * The default values are { @ link io . graceland . filter . FilterPattern # DEFAULT _ DISPATCHER _ TYPES } and
 * { @ link io . graceland . filter . FilterPattern # DEFAULT _ MATCH _ AFTER } .
 * @ param patterns The URL patterns to use . */
public static FilterPattern forPatterns ( String ... patterns ) { } }

implementation: return new FilterPattern ( DEFAULT_DISPATCHER_TYPES , DEFAULT_MATCH_AFTER , ImmutableList . copyOf ( patterns ) ) ;


signature:
public class ConfigurationContext { /** * 从资源仓库的某位置加载 。
 * @ param repository
 * 资源仓库
 * @ param selection
 * 资源仓库选择
 * @ return 加载环境
 * @ throws ConfigurationException
 * 加载错误 */
public static ConfigurationContext load ( final ResourceRepository repository , final ResourceSelection selection ) throws ConfigurationException { } }

implementation: LOG . debug ( "从 {} 加载配置集合" , selection ) ; Resource resource = repository . getResource ( selection ) ; if ( resource == null ) { throw new ConfigurationException ( selection + " 解析失败" ) ; } ResourceContextConfig contextConfig = new ResourceContextConfig ( ) ; contextConfig . load ( resource ) ; return new ConfigurationContext ( repository , contextConfig ) ;


signature:
public class ConfigurationContext { /** * 定位配置资源 。
 * @ param selection
 * 配置资源选择
 * @ return 配置资源
 * @ throws ConfigurationException
 * 配置错误 */
public Resource getConfigurationResource ( final ResourceSelection selection ) throws ConfigurationException { } }

implementation: Resource resource = getResource ( selection ) ; if ( resource == null ) { String catalog = selection . getCatalog ( ) ; String version = selection . getVersion ( ) ; String name = selection . getName ( ) ; throw new ConfigurationException ( "未找到类别 " + catalog + " 版本 " + version + " 的配置 " + name ) ; } return resource ;


signature:
public class ConfigurationContext { /** * 加载配置资源 , 返回配置对象 。
 * @ param < T >
 * 配置对象的类型
 * @ param type
 * 配置对象的类型
 * @ param selection
 * 配置资源选择
 * @ return 配置对象
 * @ throws ConfigurationException
 * 配置错误 */
public < T extends ReloadableConfigurationContainer > T getConfiguration ( final Class < T > type , final ResourceSelection selection ) throws ConfigurationException { } }

implementation:
Resource resource = getConfigurationResource ( selection ) ; T container = ( T ) containerCache . get ( resource ) ; if ( container != null ) { container . checkReload ( ) ; return container ; } synchronized ( containerCache ) { container = ( T ) containerCache . get ( resource ) ; if ( container != null ) { container . checkReload ( ) ; return container ; } try { container = type . newInstance ( ) ; } catch ( ReflectiveOperationException e ) { throw new ConfigurationException ( "配置类 " + type . getName ( ) + " 实例化失败" , e ) ; } // 加载配置
LOG . debug ( "从 {}({}) 加载配置" , selection , resource ) ; try { container . load ( resource ) ; } catch ( ConfigurationException e ) { throw new ConfigurationException ( "配置 " + resource . getDescription ( ) + " 加载错误" , e ) ; } containerCache . put ( resource , container ) ; return container ; }


signature:
public class PagableQueryParams { /** * Helper method to create an empty { @ link PagableQueryParams } .
 * @ return */
public static PagableQueryParams of ( ) { } }

implementation: return PagableQueryParams . of ( Optional . < String > absent ( ) , Optional . < Integer > absent ( ) ) ;


signature:
public class PagableQueryParams { /** * Helper method to create an empty { @ link PagableQueryParams } .
 * @ return */
public static PagableQueryParams of ( final Optional < String > optOffset , final Optional < Integer > optLimit ) { } }

implementation: return PagableQueryParams . of ( optOffset , optLimit , Optional . < SortDirection > absent ( ) , Optional . < Boolean > absent ( ) ) ;


signature:
public class ConstructorInvocation { /** * Proceeds this constructor invocation .
 * @ return The instance of the specified class .
 * @ throws Throwable If any exceptions occur while this invocation is
 * proceeding . */
public T proceed ( ) throws Throwable { } }

implementation: try { return constructor ( ) . newInstance ( args ) ; } catch ( InvocationTargetException e ) { throw e . getTargetException ( ) ; }