org.apache.pig.data.utils
Class MethodHelper

java.lang.Object
  extended by org.apache.pig.data.utils.MethodHelper

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class MethodHelper
extends Object


Nested Class Summary
static interface MethodHelper.NotImplemented
          This is an annotation which allows a class to signal that while it is "implementing" a method because it is specified by a parent class or interface, that the implementation just throws an exception, because it is not implemented.
 
Method Summary
static boolean isNotImplementedAnnotationPresent(Method m, Class<?> clazz)
          Given a method and a class, this will return true if the method is declared in the class, and if it is, if the NotImplemented annotation is present.
static RuntimeException methodNotImplemented()
           
static boolean methodSignatureEqual(Method m1, Method m2)
          This implements a stripped down version of method equality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNotImplementedAnnotationPresent

public static boolean isNotImplementedAnnotationPresent(Method m,
                                                        Class<?> clazz)
Given a method and a class, this will return true if the method is declared in the class, and if it is, if the NotImplemented annotation is present. This method will recurse through the parent class hierarchy until it finds the first instance of the method at hand, and then it will return accordingly.


methodNotImplemented

public static RuntimeException methodNotImplemented()

methodSignatureEqual

public static boolean methodSignatureEqual(Method m1,
                                           Method m2)
This implements a stripped down version of method equality. method.equals(method) checks to see whether the declaring classes are equal, which we do not want. Instead, we just want to know if the methods are equal assuming that they come from the same class hierarchy (ie generated code which extends SchemaTuple).



Copyright © 2007-2012 The Apache Software Foundation