Expression nameExpression = entry.getKey();
if (!(nameExpression instanceof SimpleStringLiteral)) {
reportErrorForNode(AngularCode.INVALID_PROPERTY_NAME, nameExpression);
continue;
}
SimpleStringLiteral nameLiteral = (SimpleStringLiteral) nameExpression;
String name = nameLiteral.getValue();
int nameOffset = nameLiteral.getValueOffset();
// prepare field specification
Expression specExpression = entry.getValue();
if (!(specExpression instanceof SimpleStringLiteral)) {
reportErrorForNode(AngularCode.INVALID_PROPERTY_SPEC, specExpression);
continue;
}
SimpleStringLiteral specLiteral = (SimpleStringLiteral) specExpression;
String spec = specLiteral.getValue();
// parse binding kind and field name
AngularPropertyKind kind;
int fieldNameOffset;
if (StringUtilities.startsWithChar(spec, '@')) {
kind = AngularPropertyKind.ATTR;
fieldNameOffset = 1;
} else if (StringUtilities.startsWithChar(spec, '&')) {
kind = AngularPropertyKind.CALLBACK;
fieldNameOffset = 1;
} else if (StringUtilities.startsWith3(spec, 0, '=', '>', '!')) {
kind = AngularPropertyKind.ONE_WAY_ONE_TIME;
fieldNameOffset = 3;
} else if (StringUtilities.startsWith2(spec, 0, '=', '>')) {
kind = AngularPropertyKind.ONE_WAY;
fieldNameOffset = 2;
} else if (StringUtilities.startsWith3(spec, 0, '<', '=', '>')) {
kind = AngularPropertyKind.TWO_WAY;
fieldNameOffset = 3;
} else {
reportErrorForNode(AngularCode.INVALID_PROPERTY_KIND, specLiteral, spec);
continue;
}
String fieldName = spec.substring(fieldNameOffset);
fieldNameOffset += specLiteral.getValueOffset();
// prepare field
PropertyAccessorElement setter = classElement.getType().lookUpSetter(
fieldName,
classElement.getLibrary());
if (setter == null) {