@ Override public String next ( ) { if ( hasNext ( ) ) { if ( enumerationSize == NULL_LOCALE_ENUMERATION_SIZE ) { cursor ++ ; return templateName ; } final String language = matcher . group ( 1 ) ; final String country = matcher . group ( 2 ) ; switch ( cursor ) { case 0 : cursor ++ ; return templateName + FILE_SEPARATOR + language + FILE_SEPARATOR + country ; case 1 : cursor ++ ; return templateName + FILE_SEPARATOR + language + UNDERSCORE + country ; case 2 : cursor ++ ; return templateName + FILE_SEPARATOR + language ; case 3 : cursor ++ ; return templateName + UNDERSCORE + language + UNDERSCORE + country ; case 4 : cursor ++ ; return templateName + UNDERSCORE + language ; case 5 : cursor ++ ; return templateName ; } } String message = "No next available template name combination." ; LOGGER . error ( message ) ; throw new IllegalStateException ( message ) ; }
Generate the next combination of template name and return .