private boolean visibilityIsPublicOrProtected ( DetailAST constructorToken ) { DetailAST modifierToken = constructorToken . findFirstToken ( TokenTypes . MODIFIERS ) ; // No modifiers means package private. if ( modifierToken == null ) { return false ; } return TokenUtil . findFirstTokenByPredicate ( modifierToken , node -> node . getType ( ) == TokenTypes . LITERAL_PUBLIC || node . getType ( ) == TokenTypes . LITERAL_PROTECTED ) . isPresent ( ) ; }
Checks if the constructor is using the public or protected scope .