.indexOf(ATTR_VALUE_SEPERATOR) + 1) : null;
String attribute = path.indexOf(ATTR_PATH_SEPERATOR) != -1 ? path.substring(path.indexOf(ATTR_PATH_SEPERATOR)
+ ATTR_PATH_SEPERATOR.length(), path.length()) : null;
String[] attributes = attribute == null ? new String[0] : attribute.split(ATTR_SEPERATOR);
Pattern pattern = new Pattern(name);
pattern.text(text);
for (String attr : attributes)
{
String[] nameValue = attr.split(ATTR_VALUE_SEPERATOR);
if (nameValue.length != 2)
{
throw new IllegalArgumentException("Attribute without name or value found: " + attr + " in expression: "
+ queryExpression);
}
pattern.attribute(nameValue[0], nameValue[1]);
}
patterns.add(pattern);
}
return patterns.toArray(ARRAY_CAST);
}