Take a look at Groovy, it adds multiple approaches to writing strings, including the standard approach, and path / regex-friendly approaches. If you're creating a lot of classes like this, might be worth writing them in Groovy.