private void overrideAbstractMethods ( ) throws IOException { for ( final ExecutableElement method : El . getEffectiveMethods ( superClass ) ) { if ( method . getModifiers ( ) . contains ( Modifier . ABSTRACT ) ) { if ( method . getAnnotation ( Terminal . class ) != null || method . getAnnotation ( Rule . class ) != null || method . getAnnotation ( Rules . class ) != null ) { implementedAbstractMethods . add ( method ) ; MethodCompiler mc = new MethodCompiler ( ) { @ Override protected void implement ( ) throws IOException { TypeMirror returnType = method . getReturnType ( ) ; List < ? extends VariableElement > params = method . getParameters ( ) ; if ( returnType . getKind ( ) != TypeKind . VOID && params . size ( ) == 1 ) { nameArgument ( ARG , 1 ) ; try { convert ( ARG , returnType ) ; } catch ( IllegalConversionException ex ) { throw new IOException ( "bad conversion with " + method , ex ) ; } treturn ( ) ; } else { if ( returnType . getKind ( ) == TypeKind . VOID && params . size ( ) == 0 ) { treturn ( ) ; } else { throw new IllegalArgumentException ( "cannot implement abstract method " + method ) ; } } } } ; subClass . overrideMethod ( mc , method , Modifier . PROTECTED ) ; } } } }
Implement abstract method which have either one parameter and returning something or void type not returning anything .