private static boolean isValidStandardOperator ( final Element e ) { if ( e . getKind ( ) == ElementKind . FIELD ) { return e . getModifiers ( ) . containsAll ( EnumSet . of ( Modifier . PUBLIC , Modifier . STATIC , Modifier . FINAL ) ) ; } if ( e . getKind ( ) == ElementKind . METHOD ) { return e . getModifiers ( ) . containsAll ( EnumSet . of ( Modifier . PUBLIC , Modifier . STATIC ) ) && ( ( ExecutableElement ) e ) . getParameters ( ) . isEmpty ( ) ; } if ( e . getKind ( ) == ElementKind . CLASS ) { if ( e . getModifiers ( ) . contains ( Modifier . ABSTRACT ) || findDefaultConstructor ( ( TypeElement ) e ) == null ) { return false ; } Element current = e ; while ( current . getKind ( ) == ElementKind . CLASS ) { final TypeElement t = ( TypeElement ) current ; if ( t . getNestingKind ( ) == NestingKind . TOP_LEVEL ) { return true ; } if ( t . getNestingKind ( ) == NestingKind . MEMBER && t . getModifiers ( ) . contains ( Modifier . STATIC ) ) { current = t . getEnclosingElement ( ) ; continue ; } break ; } } return false ; }
Must be a public static concrete class with a default constructor public static zero - arg method or public static final field .