private boolean checkStyle ( String style ) throws IOException { if ( CSL . supportsStyle ( style ) ) { //style is supported return true ; } //style is not supported. look for alternatives. String message = "Could not find style in classpath: " + style ; Set < String > availableStyles = CSL . getSupportedStyles ( ) ; //output alternative if ( ! availableStyles . isEmpty ( ) ) { String dyms = ToolUtils . getDidYouMeanString ( availableStyles , style ) ; if ( dyms != null && ! dyms . isEmpty ( ) ) { message += "\n\n" + dyms ; } } error ( message ) ; return false ; }
Checks if the given style exists and output possible alternatives if it does not