if ( key.contains("@") ) {
return Arrays.<PathElement>asList( new AtPathElement( key ) );
}
else if ( key.contains("$") ) {
return Arrays.<PathElement>asList( new DollarPathElement( key ) );
}
else if ( key.contains("[") ) {
if ( StringUtils.countMatches( key, "[" ) != 1 || StringUtils.countMatches( key, "]" ) != 1 ) {
throw new SpecException( "Invalid key:" + key + " has too many [] references.");