this.pageSpecReader = pageSpecReader;
}
@Override
public void process(String line, Place place) {
StringCharReader reader = new StringCharReader(line);
String objectName = expectWord(reader, "Object name is not defined correctly");
try {
String word = expectCorrectionsOrId(reader, objectName);
String locatorType;
CorrectionsRect corrections = null;
if (word.equals(CORRECTIONS_SYMBOL)) {
corrections = Expectations.corrections().read(reader);
locatorType = expectWord(reader, format("Missing locator for object \"%s\"", objectName));
}
else locatorType = word;
String value = reader.getTheRest().trim();
if (value.isEmpty()) {
throw new SyntaxException(UNKNOWN_LINE, format("Locator for object \"%s\" is not defined correctly", objectName));
}
addObjectToSpec(objectName, locatorType, corrections, value);
}