question: @ Nullable private static String referenceToAttribute ( String attrib , boolean includeDummies ) { while ( attrib . startsWith ( "\\\\" ) ) { attrib = attrib . substring ( 2 ) ; } if ( attrib . startsWith ( "\\$" ) ) { if ( includeDummies ) { attrib = attrib . substring ( 1 ) ; } else return null ; } if ( ! StringUtil . startsWithChar ( attrib , '$' ) ) { return null ; } attrib = attrib . substring ( 1 ) ; if ( StringUtil . startsWithChar ( attrib , '{' ) ) { String cleanAttribute = null ; for ( int i = 1 ; i < attrib . length ( ) ; i ++ ) { char currChar = attrib . charAt ( i ) ; if ( currChar == '{' || currChar == '.' ) { cleanAttribute = null ; break ; } else if ( currChar == '}' ) { cleanAttribute = attrib . substring ( 1 , i ) ; break ; } } attrib = cleanAttribute ; } else { for ( int i = 0 ; i < attrib . length ( ) ; i ++ ) { char currChar = attrib . charAt ( i ) ; if ( currChar == '{' || currChar == '}' || currChar == '.' ) { attrib = attrib . substring ( 0 , i ) ; break ; } } } return attrib ; }
target:  Removes each two leading '\', removes leading $, removes {} Examples: $qqq   -> qqq \$qqq  -> qqq if dummy attributes are collected too, null otherwise \\$qqq -> qqq ${qqq} -> qqq