private void introspectMethods ( JavaClass jClass ) { for ( Method method : getMethods ( ) ) { Class < ? > [ ] paramTypes = method . getParameterTypes ( ) ; int paramLen = paramTypes . length ; if ( ! Modifier . isAbstract ( method . getModifiers ( ) ) ) { continue ; } if ( Modifier . isStatic ( method . getModifiers ( ) ) ) { continue ; } if ( Modifier . isFinal ( method . getModifiers ( ) ) ) { continue ; } /* if (! Modifier.isPublic(method.getModifiers())) { throw new IllegalArgumentException("Method must be public {0}", method); } */ if ( method . getDeclaringClass ( ) . equals ( Object . class ) ) { continue ; } if ( method . getName ( ) . equals ( "toString" ) && paramLen == 0 ) { continue ; } if ( method . getName ( ) . equals ( "hashCode" ) && paramLen == 0 ) { continue ; } if ( method . getName ( ) . equals ( "equals" ) && paramLen == 1 && paramTypes [ 0 ] . equals ( Object . class ) ) { continue ; } // XXX: Need QA int ampResult = findAmpResult ( paramTypes , Result . class ) ; if ( isCreate ( method ) || isFind ( method ) ) { if ( ampResult < 0 ) { throw new IllegalStateException ( L . l ( "Result argument is required {0}" , method ) ) ; } if ( ! void . class . equals ( method . getReturnType ( ) ) ) { throw new IllegalArgumentException ( L . l ( "method must return void {0}" , method ) ) ; } } if ( paramLen > 0 && ampResult >= 0 ) { /* if (ampResult != paramTypes.length - 1) { throw new IllegalStateException(L.l("invalid Result position. Result must be the final argument.")); } */ createAmpResultMethod ( jClass , method , ampResult ) ; } else if ( ampResult < 0 ) { createAmpSendMethod ( jClass , method ) ; } else { throw new IllegalStateException ( method . toString ( ) ) ; } } }
Introspect the methods to find abstract methods .