private void processSecurityRoles ( WebAnnotations webAnnotations , Set < String > classesWithSecurityRoles , Class < ? extends Annotation > securityAnnotation , boolean annotationForClass ) throws UnableToAdaptException { for ( String classWithSecurityRole : classesWithSecurityRoles ) { ClassInfo classInfo = webAnnotations . getClassInfo ( classWithSecurityRole ) ; final String fullyQualifiedClassName = classWithSecurityRole ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "@" + securityAnnotation . getSimpleName ( ) + " found on class " , fullyQualifiedClassName ) ; } AnnotationInfo rolesAnnotation = null ; if ( annotationForClass ) { rolesAnnotation = classInfo . getAnnotation ( securityAnnotation ) ; getRoleValues ( rolesAnnotation ) ; } else { for ( MethodInfo methodInfo : classInfo . getDeclaredMethods ( ) ) { rolesAnnotation = methodInfo . getAnnotation ( securityAnnotation ) ; getRoleValues ( rolesAnnotation ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "allRoles: " + allRoles ) ; } }
Create a list of roles that represent the security annotation