1 14 15 package com.sun.facelets.el; 16 17 import java.io.Serializable ; 18 19 import javax.el.ELException; 20 import javax.el.MethodExpression; 21 import javax.faces.context.FacesContext; 22 import javax.faces.el.EvaluationException; 23 import javax.faces.el.MethodBinding; 24 import javax.faces.el.MethodNotFoundException; 25 26 33 public final class LegacyMethodBinding extends 34 MethodBinding implements Serializable { 35 36 private static final long serialVersionUID = 1L; 37 38 private final MethodExpression m; 39 40 public LegacyMethodBinding(MethodExpression m) { 41 this.m = m; 42 } 43 44 49 public Class getType(FacesContext context) 50 throws MethodNotFoundException { 51 try { 52 return m.getMethodInfo(ELAdaptor.getELContext(context)).getReturnType(); 53 } catch (javax.el.MethodNotFoundException e) { 54 throw new MethodNotFoundException(e.getMessage(), e.getCause()); 55 } catch (ELException e) { 56 throw new EvaluationException(e.getMessage(), e.getCause()); 57 } 58 } 59 60 66 public Object invoke(FacesContext context, Object [] params) 67 throws EvaluationException, MethodNotFoundException { 68 try { 69 return m.invoke(ELAdaptor.getELContext(context), params); 70 } catch (javax.el.MethodNotFoundException e) { 71 throw new MethodNotFoundException(e.getMessage(), e.getCause()); 72 } catch (ELException e) { 73 throw new EvaluationException(e.getMessage(), e.getCause()); 74 } 75 } 76 77 public String getExpressionString() { 78 return m.getExpressionString(); 79 } 80 } | Popular Tags |