public static MemberExistsResult fieldExists ( String fieldName , JavacNode node ) { node = upToTypeNode ( node ) ; if ( node != null && node . get ( ) instanceof JCClassDecl ) { for ( JCTree def : ( ( JCClassDecl ) node . get ( ) ) . defs ) { if ( def instanceof JCVariableDecl ) { if ( ( ( JCVariableDecl ) def ) . name . contentEquals ( fieldName ) ) { return getGeneratedBy ( def ) == null ? MemberExistsResult . EXISTS_BY_USER : MemberExistsResult . EXISTS_BY_LOMBOK ; } } } } return MemberExistsResult . NOT_EXISTS ; }
Checks if there is a field with the provided name .