throw new SpecException( "Invalid key:" + key + " has too many [] references.");
}
// is canonical array?
if ( key.charAt( 0 ) == '[' && key.charAt( key.length() - 1 ) == ']') {
return Arrays.<PathElement>asList( new ArrayPathElement( key ) );
}
// Split syntactic sugar of "photos[]" --> [ "photos", "[]" ]
// or "bob-&(3,1)-smith[&0]" --> [ "bob-&(3,1)-smith", "[&(0,0)]" ]