private String createExpressionKey ( String suffix ) { String [ ] parts = suffix . split ( "_" ) ; StringBuilder ret = new StringBuilder ( "[if " ) ; boolean ieAdded = false ; for ( String part : parts ) { if ( "" . equals ( part ) ) { continue ; } if ( "ie" . equals ( part ) ) { break ; } else if ( Pattern . matches ( "(lt|lte|gt|gte)" , part ) ) { ret . append ( part ) . append ( " " ) ; } else { ret . append ( "IE " ) . append ( part ) ; ieAdded = true ; } } if ( ! ieAdded ) ret . append ( "IE" ) ; ret . append ( "]" ) ; return ret . toString ( ) ; }
Creates an IE conditional expression by transforming the suffix of a filename .