public Method resolveFunction(String prefix, String localName) { throw new ReferenceSyntaxException(); } };
public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException { if (base instanceof FlowExecution) { throw new ReferenceSyntaxException("Cannot apply an index value to a flow execution"); } else { return resolverDelegate.getValue(base, index); } }
public void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException { if (base instanceof FlowExecution) { throw new ReferenceSyntaxException("Cannot apply an index value to a flow execution"); } else { resolverDelegate.setValue(base, index, value); } }
public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException { if (base == null) { return null; } try { if (base.getClass().isArray()) { return Array.get(base, index); } if (base instanceof List) { return ((List) base).get(index); } if (base instanceof UIComponent) { return ((UIComponent) base).getChildren().get(index); } } catch (IndexOutOfBoundsException e) { return null; } throw new ReferenceSyntaxException("Must be array or List. Bean: " + base.getClass().getName() + ", index " + index); }
@SuppressWarnings("deprecation") private static String stripBracketsIfNecessary(String expression) throws ReferenceSyntaxException { assert (null != expression); // look for invalid expressions if (expression.charAt(0) == '#') { if (expression.charAt(1) != '{') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } int len = expression.length(); if (expression.charAt(len - 1) != '}') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } expression = expression.substring(2, len - 1); } return expression; }
public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException { if (base == null) { return null; } try { if (base.getClass().isArray()) { return Array.get(base, index); } if (base instanceof List) { return ((List) base).get(index); } if (base instanceof UIComponent) { return ((UIComponent) base).getChildren().get(index); } } catch (IndexOutOfBoundsException e) { return null; } throw new ReferenceSyntaxException("Must be array or List. Bean: " + base.getClass().getName() + ", index " + index); }
@SuppressWarnings("deprecation") private static String stripBracketsIfNecessary(String expression) throws ReferenceSyntaxException { assert (null != expression); // look for invalid expressions if (expression.charAt(0) == '#') { if (expression.charAt(1) != '{') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } int len = expression.length(); if (expression.charAt(len - 1) != '}') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } expression = expression.substring(2, len - 1); } return expression; }
@SuppressWarnings("deprecation") private static String stripBracketsIfNecessary(String expression) throws ReferenceSyntaxException { assert (null != expression); // look for invalid expressions if (expression.charAt(0) == '#') { if (expression.charAt(1) != '{') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } int len = expression.length(); if (expression.charAt(len - 1) != '}') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } expression = expression.substring(2, len - 1); } return expression; }
@SuppressWarnings("deprecation") private static String stripBracketsIfNecessary(String expression) throws ReferenceSyntaxException { assert (null != expression); // look for invalid expressions if (expression.charAt(0) == '#') { if (expression.charAt(1) != '{') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } int len = expression.length(); if (expression.charAt(len - 1) != '}') { throw new ReferenceSyntaxException(MessageUtils.getExceptionMessageString( MessageUtils.INVALID_EXPRESSION_ID, expression)); } expression = expression.substring(2, len - 1); } return expression; }
public Integer toIndex(Object base, Object index) throws ReferenceSyntaxException { Integer indexValue = null; if (base instanceof List || base.getClass().isArray()) { indexValue = CoercionsUtil.coerceToInteger(index); if (indexValue == null) { throw new ReferenceSyntaxException(); } } else if (base instanceof UIComponent) { indexValue = CoercionsUtil.coerceToInteger(index); } return indexValue; }
/** * @see javax.faces.application.Application#createValueBinding(String) */ @Deprecated public ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException { notNull("ref", ref); ValueExpression result; FacesContext context = FacesContext.getCurrentInstance(); // return a ValueBinding that wraps a ValueExpression. try { result = getExpressionFactory().createValueExpression(context.getELContext(), ref, Object.class); } catch (ELException elex) { throw new ReferenceSyntaxException(elex); } return new ValueBindingValueExpressionAdapter(result); }
/** * @see javax.faces.application.Application#createValueBinding(String) */ @Deprecated public ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException { notNull("ref", ref); ValueExpression result; FacesContext context = FacesContext.getCurrentInstance(); // return a ValueBinding that wraps a ValueExpression. try { result = getExpressionFactory().createValueExpression(context.getELContext(), ref, Object.class); } catch (ELException elex) { throw new ReferenceSyntaxException(elex); } return new ValueBindingValueExpressionAdapter(result); }
public Object parse(final String expression) { String jspExpression = JspELParserUtil .convertToJspExpression(expression); ELParser parser = new ELParser(new StringReader(jspExpression)); try { Object obj = parser.ExpressionString(); getExpressionProcessor().processExpression(obj, Object.class); return obj; } catch (ParseException e) { throw new ReferenceSyntaxException(); } }
private Object[] getBaseAndProperty(FacesContext context) throws ReferenceSyntaxException { Object expression = vb_.getExpression(); Object o = parser_.getExpressionProcessor().resolveBase(context, expression); if (!(o instanceof Object[])) { throw new ReferenceSyntaxException(); } Object[] obj = (Object[]) o; return obj; } }
@SuppressWarnings("deprecation") public ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException { if (ref == null) { String message = MessageUtils.getExceptionMessageString (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "ref"); throw new NullPointerException(message); } ValueExpression result; FacesContext context = FacesContext.getCurrentInstance(); // return a ValueBinding that wraps a ValueExpression. try { result= getExpressionFactory(). createValueExpression(context.getELContext(),ref, Object.class); } catch (ELException elex) { throw new ReferenceSyntaxException(elex); } return (new ValueBindingValueExpressionAdapter(result)); }
/** * @see javax.faces.application.Application#createValueBinding(String) */ @SuppressWarnings("deprecation") public ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException { Util.notNull("ref", ref); ValueExpression result; FacesContext context = FacesContext.getCurrentInstance(); // return a ValueBinding that wraps a ValueExpression. try { result= getExpressionFactory(). createValueExpression(context.getELContext(),ref, Object.class); } catch (ELException elex) { throw new ReferenceSyntaxException(elex); } return (new ValueBindingValueExpressionAdapter(result)); }
/** * @deprecated */ @Override public ValueBinding createValueBinding(String reference) throws ReferenceSyntaxException { checkNull(reference, "reference"); checkEmpty(reference, "reference"); ValueExpression valueExpression; try { valueExpression = getExpressionFactory().createValueExpression(threadELContext(), reference, Object.class); } catch (ELException e) { throw new ReferenceSyntaxException(e); } return new ValueExpressionToValueBinding(valueExpression); }
/** * @deprecated */ @Override public final ValueBinding createValueBinding(final String reference) throws ReferenceSyntaxException { checkNull(reference, "reference"); checkEmpty(reference, "reference"); ValueExpression valueExpression; try { valueExpression = getExpressionFactory().createValueExpression(threadELContext(), reference, Object.class); } catch (ELException e) { throw new ReferenceSyntaxException(e); } return new ValueExpressionToValueBinding(valueExpression); }
/** * @deprecated */ @Override public final ValueBinding createValueBinding(final String reference) throws ReferenceSyntaxException { checkNull(reference, "reference"); checkEmpty(reference, "reference"); ValueExpression valueExpression; try { valueExpression = getExpressionFactory().createValueExpression(threadELContext(), reference, Object.class); } catch (ELException e) { throw new ReferenceSyntaxException(e); } return new ValueExpressionToValueBinding(valueExpression); }
/** * @deprecated */ @Override public final ValueBinding createValueBinding(final String reference) throws ReferenceSyntaxException { checkNull(reference, "reference"); checkEmpty(reference, "reference"); ValueExpression valueExpression; try { valueExpression = getExpressionFactory().createValueExpression( threadELContext(), reference, Object.class); } catch (ELException e) { throw new ReferenceSyntaxException(e); } return new ValueExpressionToValueBinding(valueExpression); }