private static String languageVersion ( String language , String className , String methodOrFieldName , boolean isMethod ) { StringBuilder sb = new StringBuilder ( ) ; try { Class < ? > clz = Class . forName ( className ) ; sb . append ( language ) ; String version = isMethod ? ( String ) clz . getMethod ( methodOrFieldName ) . invoke ( null ) : ( String ) clz . getField ( methodOrFieldName ) . get ( null ) ; concat ( sb , version , "/" ) ; } catch ( ClassNotFoundException e ) { //Ignore } catch ( Exception e ) { if ( log . isTraceEnabled ( ) ) { log . trace ( "Exception attempting to get " + language + " version." , e ) ; } } return sb . toString ( ) ; }
Attempt to determine if this language exists on the classpath and what it s version is