private boolean methodMatchsModelGET ( Method method ) { boolean condition = false ; try { if ( isModelCache . contains ( method ) ) { condition = true ; return condition ; } String mehtodName = method . getName ( ) ; if ( method . getReturnType ( ) == null ) return condition ; // 无返回值，不做缓存 Class returnClass = method . getReturnType ( ) ; if ( returnClass . getSuperclass ( ) == null ) return condition ; // 无返回值，不做缓存 Debug . logVerbose ( "[JdonFramework]methodMatchsModelGET: returnClassName = " + returnClass . getName ( ) , module ) ; if ( ModelUtil . isModel ( returnClass ) ) { if ( mehtodName . indexOf ( match_MethodName ) != - 1 ) { condition = true ; // method name include "getXXXX" and return Type is subClass // of Model isModelCache . add ( method ) ; } } } catch ( Exception ex ) { Debug . logError ( "[JdonFramework]Exception error:" + ex , module ) ; } catch ( Throwable the ) { Debug . logError ( "[JdonFramework]Throwable error:" + the , module ) ; } return condition ; }
1 . check return type if is Model 2 . check method name if include get 3 . if found them cache this method