@SuppressWarnings("rawtypes") protected Object nextStep(Object o, String attributeName, ErrorHandler errorHandler, Token token) { Object result; if (o instanceof String) { errorHandler.error("no-call-on-string", token, new ModelBuilder( "receiver", o.toString()).build()); return o; } else if (o instanceof Map) { Map map = (Map) o; result = map.get(attributeName); } else { try { result = getPropertyValue(o, attributeName); } catch (Exception e) { errorHandler.error("property-access-error", token, new ModelBuilder("property", attributeName, "object", o, "exception", e).build()); result = ""; } } return result; }
if ( array == null ) { errorHandler.error(NOT_ARRAY, token, new ModelBuilder("array", "[null]").build()); return ERROR_STRING; if (array != ERROR_STRING) { errorHandler.error(INDEX_OUT_OF_BOUNDS, token, new ModelBuilder("arrayIndex", arrayIndex, "array", array.toString()).build()); if (array != ERROR_STRING) { errorHandler.error(INVALID_INDEX, token, new ModelBuilder("arrayIndex", arrayIndex, "array", array.toString()).build()); new ModelBuilder("array", array.toString()).build()); if (array != ERROR_STRING) { errorHandler.error(INDEX_OUT_OF_BOUNDS, token, new ModelBuilder("arrayIndex", arrayIndex, "array", array.toString()).build());
if (o instanceof String) { if (o != ERROR_STRING) { errorHandler.error(NO_CALL_ON_STRING, token, new ModelBuilder( "receiver", o.toString()).build()); if (arrayAccess && !Util.isValidArrayAccess(attributeName)) { errorHandler.error(INVALID_ARRAY_SYNTAX, token, new ModelBuilder("arrayExpression", attributeName).build()); return ERROR_STRING; if (o != ERROR_STRING) { errorHandler.error(PROPERTY_ACCESS, token, new ModelBuilder("property", rawAttributeName, "object", o, "exception", e).build());