if (context == null) {
throw new NullPointerException();
}
if (base != null && base instanceof List) {
if (isReadOnly) {
throw new PropertyNotWritableException();
}
String str = property.toString();
if ("add".equals(str)) {
if (Debug.verboseOn()) {
Debug.logVerbose("ExtendedListResolver.setValue adding List element: base = " + base + ", property = " + property + ", value = " + val, module);
}
context.setPropertyResolved(true);
List list = (List) base;
list.add(val);
} else if (str.startsWith("insert@")) {
if (Debug.verboseOn()) {
Debug.logVerbose("ExtendedListResolver.setValue inserting List element: base = " + base + ", property = " + property + ", value = " + val, module);
}
context.setPropertyResolved(true);
String indexStr = str.replace("insert@", "");
int index = Integer.parseInt(indexStr);
List list = (List) base;
try {
list.add(index, val);
} catch (UnsupportedOperationException ex) {
throw new PropertyNotWritableException();
} catch (IndexOutOfBoundsException ex) {
throw new PropertyNotFoundException();
}
} else {
super.setValue(context, base, property, val);