public static String [ ] toRole ( Object oRoles ) throws PageException { if ( oRoles instanceof String ) { oRoles = ListUtil . listToArrayRemoveEmpty ( oRoles . toString ( ) , "," ) ; } if ( oRoles instanceof Array ) { Array arrRoles = ( Array ) oRoles ; String [ ] roles = new String [ arrRoles . size ( ) ] ; for ( int i = 0 ; i < roles . length ; i ++ ) { roles [ i ] = Caster . toString ( arrRoles . get ( i + 1 , "" ) ) ; } return roles ; } throw new ApplicationException ( "invalid roles definition for tag loginuser" ) ; }
convert a Object to a String Array of Roles