@Override
@SuppressWarnings("unchecked")
public Object nullPropertyValue(Map context, Object target, Object property) {
OgnlContext ctx = (OgnlContext) context;
int indexInParent = ctx.getCurrentEvaluation().getNode().getIndexInParent();
int maxIndex = ctx.getRootEvaluation().getNode().jjtGetNumChildren() - 1;
if (!(indexInParent != -1 && indexInParent < maxIndex)) {
return null;
}
try {
Container container = (Container) context.get(Container.class);
if (target instanceof List) {
return list.instantiate(container, target, property, ctx.getCurrentEvaluation().getPrevious());
}
String propertyCapitalized = Info.capitalize((String) property);
Method getter = findMethod(target.getClass(), "get" + propertyCapitalized, target.getClass(), null);
Type returnType = getter.getGenericReturnType();