incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r454004 - in /incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component: MethodBindingMethodExpression.java MethodExpressionMethodBinding.java
Date Sat, 07 Oct 2006 19:59:09 GMT
Author: awiner
Date: Sat Oct  7 12:59:08 2006
New Revision: 454004

URL: http://svn.apache.org/viewvc?view=rev&rev=454004
Log:
Commit missing files

Added:
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodBindingMethodExpression.java
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodExpressionMethodBinding.java

Added: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodBindingMethodExpression.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodBindingMethodExpression.java?view=auto&rev=454004
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodBindingMethodExpression.java
(added)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodBindingMethodExpression.java
Sat Oct  7 12:59:08 2006
@@ -0,0 +1,67 @@
+package org.apache.myfaces.trinidad.component;
+
+import java.io.Serializable;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+
+
+@Deprecated
+class MethodBindingMethodExpression
+  extends MethodExpression implements Serializable
+{
+
+  // TODO implement serialization correctly?
+  public MethodBindingMethodExpression(MethodBinding binding)
+  {
+    _binding = binding;
+  }
+  
+  public MethodBinding getMethodBinding()
+  {
+    return _binding;
+  }
+
+  public MethodInfo getMethodInfo(ELContext context)
+  {
+    Class type = _binding.getType(FacesContext.getCurrentInstance());
+    return new MethodInfo(null, type, null);
+  }
+
+  public Object invoke(ELContext elContext, Object[] params)
+  {
+    return _binding.invoke(FacesContext.getCurrentInstance(), params);
+  }
+
+  public String getExpressionString()
+  {
+    return _binding.getExpressionString();
+  }
+
+  public boolean isLiteralText()
+  {
+    return false;
+  }
+
+  public boolean equals(Object o)
+  {
+    if (o == this)
+      return true;
+    if (!(o instanceof MethodBindingMethodExpression))
+      return false;
+      
+    MethodBindingMethodExpression that = (MethodBindingMethodExpression) o;
+    return that._binding.equals(_binding);
+  }
+
+  public int hashCode()
+  {
+    return _binding.hashCode();
+  }
+
+  private final MethodBinding _binding;
+}

Added: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodExpressionMethodBinding.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodExpressionMethodBinding.java?view=auto&rev=454004
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodExpressionMethodBinding.java
(added)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/MethodExpressionMethodBinding.java
Sat Oct  7 12:59:08 2006
@@ -0,0 +1,42 @@
+package org.apache.myfaces.trinidad.component;
+
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+
+@Deprecated
+class MethodExpressionMethodBinding extends MethodBinding
+{
+  public MethodExpressionMethodBinding(MethodExpression me)
+  {
+    _me = me;
+  }
+
+  public MethodExpression getMethodExpression()
+  {
+    return _me;
+  }
+  
+  public Object invoke(FacesContext facesContext, Object[] params)
+  {
+    return _me.invoke(facesContext.getELContext(), params);
+  }
+
+  public Class getType(FacesContext facesContext)
+  {
+    MethodInfo mi = _me.getMethodInfo(facesContext.getELContext());
+    if (mi == null)
+      return null;
+
+    return mi.getReturnType();
+  }
+
+  public String getExpressionString()
+  {
+    return _me.getExpressionString();
+  }
+  
+  private final MethodExpression _me;
+}



Mime
View raw message