private < T > Class < ? extends Annotation > matchAnnotationToScope ( Annotation [ ] annotations ) { for ( Annotation next : annotations ) { Class < ? extends Annotation > nextType = next . annotationType ( ) ; if ( nextType . getAnnotation ( BindingScope . class ) != null ) { return nextType ; } } return DefaultBinding . class ; }
Helper method for matching and returning a scope annotation