goja-web/src/main/java/goja/plugins/shiro/ShiroPlugin.java
private void scanAnnotation(List<AuthzHandler> authzArray,
                                List<Annotation> annotations) {
        if (null == annotations || 0 == annotations.size()) {
            return;
        }
        for (Annotation a : annotations) {
            if (a instanceof RequiresRoles) {
                authzArray.set(0, new RoleAuthzHandler(a));
            } else if (a instanceof RequiresPermissions) {
                authzArray.set(1, new PermissionAuthzHandler(a));
            } else if (a instanceof RequiresAuthentication) {
                authzArray.set(2, AuthenticatedAuthzHandler.me());
            } else if (a instanceof RequiresUser) {
                authzArray.set(3, UserAuthzHandler.me());
            } else if (a instanceof RequiresGuest) {
                authzArray.set(4, GuestAuthzHandler.me());
            }
        }
    }
private void scanAnnotation(List<AuthzHandler> authzArray,
                                List<Annotation> annotations) {
        if (null == annotations || 0 == annotations.size()) {
            return;
        }
        for (Annotation a : annotations) {
            if (a instanceof RequiresRoles) {
                authzArray.set(0, new RoleAuthzHandler(a));
            } else if (a instanceof RequiresPermissions) {
                authzArray.set(1, new PermissionAuthzHandler(a));
            } else if (a instanceof RequiresAuthentication) {
                authzArray.set(2, AuthenticatedAuthzHandler.me());
            } else if (a instanceof RequiresUser) {
                authzArray.set(3, UserAuthzHandler.me());
            } else if (a instanceof RequiresGuest) {
                authzArray.set(4, GuestAuthzHandler.me());
            }
        }
    }
private void scanAnnotation ( List < AuthzHandler > authzArray , List < Annotation > annotations ) { if ( null == annotations || 0 == annotations . size ( ) ) { return ; } for ( Annotation a : annotations ) { if ( a instanceof RequiresRoles ) { authzArray . set ( 0 , new RoleAuthzHandler ( a ) ) ; } else if ( a instanceof RequiresPermissions ) { authzArray . set ( 1 , new PermissionAuthzHandler ( a ) ) ; } else if ( a instanceof RequiresAuthentication ) { authzArray . set ( 2 , AuthenticatedAuthzHandler . me ( ) ) ; } else if ( a instanceof RequiresUser ) { authzArray . set ( 3 , UserAuthzHandler . me ( ) ) ; } else if ( a instanceof RequiresGuest ) { authzArray . set ( 4 , GuestAuthzHandler . me ( ) ) ; } } }
逐个扫描注解，若是相应的注解则在相应的位置赋值。 注解的处理是有顺序的，依次为RequiresRoles，RequiresPermissions，
RequiresAuthentication，RequiresUser，RequiresGuest
逐个扫描注解，若是相应的注解则在相应的位置赋值。 注解的处理是有顺序的，依次为RequiresRoles，RequiresPermissions， RequiresAuthentication，RequiresUser，RequiresGuest