elementProperty = new MapKeyProperty(key, elementType.getNestedType(1), null);
} else if (owningProperty.isCollection()) {
elementType = owningProperty.getType().getNestedType(0);
try {
int index = Integer.valueOf(elementPropertyExpression.replaceAll("[\\[\\]]", ""));
elementProperty = new ListElementProperty(index, elementType, null);
} catch (NumberFormatException e) {
throw new IllegalArgumentException("'" + p + "' is not a valid element property for " + type);
}
} else if (owningProperty.isArray()) {
elementType = owningProperty.getType().getComponentType();