throw new PropertyAccessException("could not access property", property, cursor, e, pCtx); throw new PropertyAccessException("could not access property", property, cursor, e, pCtx); throw new PropertyAccessException("array or collections index out of bounds in property: " + new String(property, cursor, length), property, cursor, e, pCtx); throw new PropertyAccessException("null pointer exception in property: " + new String(property), property, cursor, e, pCtx); throw new PropertyAccessException("unknown exception in expression: " + new String(property), property, cursor, e, pCtx);
public class CustomBindingErrorProcessor implements DefaultBindingErrorProcessor { public void processMissingFieldError(String missingField, BindException errors) { super.processMissingFieldError(missingField, errors); } public void processPropertyAccessException(PropertyAccessException accessException, BindException errors) { if(accessException.getCause() instanceof IllegalArgumentException) errors.rejectValue(accessException.getPropertyChangeEvent().getPropertyName(), "<SOME_SPECIFIC_CODE_IF_YOU_WANT>", accessException.getCause().getMessage()); else defaultSpringBindingErrorProcessor.processPropertyAccessException(accessException, errors); } }
private void setParserContext(ParserContext pCtx) { if (pCtx != null) { setEvaluationContext(pCtx.getEvaluationContext()); } } }
@Override public Object eval(final Map<String, Object> vars) { try { return MVEL.executeExpression(mvelExpression, vars); } catch (CompileException e) { e.getMessage(); if (e.getLineNumber() == 1) { e.setColumn((e.getColumn() + column) - 1); } e.setLineNumber((e.getLineNumber() + lineNumber) - 1); throw e; } catch (NoClassDefFoundError e) { PropertyAccessException pe = new PropertyAccessException( "Type of variable or property could not be resolved during evaluating expression.", expression.toCharArray(), 0, e, null); pe.setColumn(column); pe.setLineNumber(lineNumber); throw pe; } }
throw new PropertyAccessException("could not access property", e); throw new PropertyAccessException("could not access property", e); throw new PropertyAccessException("array or collections index out of bounds in property: " + new String(property), e); throw new PropertyAccessException("failed to access property: " + new String(property) + ": " + e.getMessage(), e); throw new PropertyAccessException("null pointer exception in property: " + new String(property), e); throw new PropertyAccessException("unknown exception in expression: " + new String(property), e);
public PropertyAccessException(String message, char[] expr, int cursor, ParserContext pCtx) { super(message, expr, cursor); setParserContext(pCtx); }
throw new PropertyAccessException(new String(expr), e); throw new PropertyAccessException(new String(expr), e); throw new PropertyAccessException(new String(expr), e); throw new CompileException(e.getMessage(), e); throw new PropertyAccessException(new String(expr), e);
public PropertyAccessException(String message, char[] expr, int cursor, Throwable e, ParserContext pCtx) { super(message, expr, cursor, e); setParserContext(pCtx); }
throw new PropertyAccessException("could not access property", property, cursor, e, pCtx); throw new PropertyAccessException("could not access property", property, cursor, e, pCtx); throw new PropertyAccessException("array or collections index out of bounds in property: " + new String(property, cursor, length), property, cursor, e, pCtx); throw new PropertyAccessException("null pointer exception in property: " + new String(property), property, cursor, e, pCtx); throw new PropertyAccessException("unknown exception in expression: " + new String(property), property, cursor, e, pCtx);
throw new PropertyAccessException(new String(expr), expr, st, e, pCtx); throw new PropertyAccessException(new String(expr), expr, st, e, pCtx); throw new PropertyAccessException(new String(expr), expr, st, e, pCtx); throw new CompileException(e.getMessage(), expr, st, e); throw new PropertyAccessException(new String(expr), expr, st, e, pCtx);
public class CustomBindingErrorProcessor extends DefaultBindingErrorProcessor { public void processPropertyAccessException(PropertyAccessException accessException, BindingResult bindingResult) { if(accessException.getCause() instanceof IllegalArgumentException){ String fieldName = accessException.getPropertyChangeEvent().getPropertyName(); String exceptionError = accessException.getCause().getMessage(); FieldError fieldError = new FieldError(fieldName, "BINDING_ERROR", fieldName + ": " + exceptionError); bindingResult.addError(fieldError); }else{ super.processPropertyAccessException(accessException, bindingResult); } } }
public PropertyAccessException(String message, char[] expr, int cursor, ParserContext pCtx) { super(message, expr, cursor); setParserContext(pCtx); }
private void setParserContext(ParserContext pCtx) { if (pCtx != null) { setEvaluationContext(pCtx.getEvaluationContext()); } } }
throw new PropertyAccessException("unterminated '['", property, cursor, pCtx); int count = (Integer) eval(prop, ctx, variableFactory); if (count > ((Collection) ctx).size()) throw new PropertyAccessException("index [" + count + "] out of bounds on collections", property, cursor, pCtx); throw new PropertyAccessException("illegal use of []: unknown type: " + (ctx.getClass().getName()), property, st, e, pCtx);
throw new PropertyAccessException(new String(expr), expr, st, e, pCtx); throw new PropertyAccessException(new String(expr), expr, st, e, pCtx); throw new PropertyAccessException(new String(expr), expr, st, e, pCtx); throw new CompileException(e.getMessage(), expr, st, e); throw new PropertyAccessException(new String(expr), expr, st, e, pCtx);
final Respond respond = new StringBuilderRespond(new Object()); Throwable cause = pae.getCause();
public PropertyAccessException(String message, char[] expr, int cursor, Throwable e, ParserContext pCtx) { super(message, expr, cursor, e); setParserContext(pCtx); }