/**
* Parses {@link AngularPropertyElement}s from {@link #annotation}.
*/
private void parseComponentProperties_fromMap(List<AngularPropertyElement> properties) {
Expression mapExpression = getArgument("map");
// may be not properties
if (mapExpression == null) {
return;
}
// prepare map literal
if (!(mapExpression instanceof MapLiteral)) {
reportErrorForNode(AngularCode.INVALID_PROPERTY_MAP, mapExpression);
return;
}
MapLiteral mapLiteral = (MapLiteral) mapExpression;
// analyze map entries
for (MapLiteralEntry entry : mapLiteral.getEntries()) {
// prepare property name
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;