protected void initCommandGroupMembers ( CommandGroup group ) { for ( int i = 0 ; i < members . length ; i ++ ) { Object o = members [ i ] ; if ( o instanceof AbstractCommand ) { group . addInternal ( ( AbstractCommand ) o ) ; configureIfNecessary ( ( AbstractCommand ) o ) ; } else if ( o instanceof Component ) { group . addComponentInternal ( ( Component ) o ) ; } else if ( o instanceof String ) { String str = ( String ) o ; if ( str . equalsIgnoreCase ( SEPARATOR_MEMBER_CODE ) ) { group . addSeparatorInternal ( ) ; } else if ( str . equalsIgnoreCase ( GLUE_MEMBER_CODE ) ) { group . addGlueInternal ( ) ; } else if ( str . startsWith ( COMMAND_MEMBER_PREFIX ) ) { String commandId = str . substring ( COMMAND_MEMBER_PREFIX . length ( ) ) ; if ( ! StringUtils . hasText ( commandId ) ) { throw new InvalidGroupMemberEncodingException ( "The group member encoding does not specify a command id" , str ) ; } addCommandMember ( str . substring ( COMMAND_MEMBER_PREFIX . length ( ) ) , group ) ; } else if ( str . startsWith ( GROUP_MEMBER_PREFIX ) ) { String commandId = str . substring ( GROUP_MEMBER_PREFIX . length ( ) ) ; if ( ! StringUtils . hasText ( commandId ) ) { throw new InvalidGroupMemberEncodingException ( "The group member encoding does not specify a command id" , str ) ; } addCommandMember ( commandId , group ) ; } else { addCommandMember ( str , group ) ; } } } }
Iterates over the collection of encoded members and adds them to the given command group .