Class SignatureHelper


  • public class SignatureHelper
    extends java.lang.Object
    The Class SignatureHelper.
    Since:
    03.04.2009
    Version:
    $Revision: 1.13 $
    Author:
    oliver
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.aspectj.lang.reflect.ConstructorSignature getAsSignature​(java.lang.reflect.Constructor<?> ctor)
      Gets the as signature.
      static org.aspectj.lang.reflect.MethodSignature getAsSignature​(java.lang.reflect.Method method)
      Gets the as signature.
      static org.aspectj.lang.Signature getAsSignature​(java.lang.String label)
      Gets the as signature.
      static java.lang.String getAsString​(java.lang.String type, org.aspectj.lang.Signature sig)
      Gets the as string.
      static java.lang.String getAsString​(org.aspectj.lang.Signature sig)
      The difference to Signature.toString() is that in case of a methode or constructor the return type is not part of result.
      static boolean hasReturnType​(org.aspectj.lang.Signature signature)
      Returns true if the given signature is a MethodSignature and the return value is not of type 'void'.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getAsString

        public static java.lang.String getAsString​(org.aspectj.lang.Signature sig)
        The difference to Signature.toString() is that in case of a methode or constructor the return type is not part of result.
        Parameters:
        sig - the sig
        Returns:
        the given signature as string
      • getAsString

        public static java.lang.String getAsString​(java.lang.String type,
                                                   org.aspectj.lang.Signature sig)
        Gets the as string.
        Parameters:
        type - the type
        sig - the sig
        Returns:
        the as string
      • getAsSignature

        public static org.aspectj.lang.reflect.MethodSignature getAsSignature​(java.lang.reflect.Method method)
        Gets the as signature.
        Parameters:
        method - the method
        Returns:
        the as signature
      • getAsSignature

        public static org.aspectj.lang.reflect.ConstructorSignature getAsSignature​(java.lang.reflect.Constructor<?> ctor)
        Gets the as signature.
        Parameters:
        ctor - the ctor
        Returns:
        the as signature
      • getAsSignature

        public static org.aspectj.lang.Signature getAsSignature​(java.lang.String label)
                                                         throws java.lang.ReflectiveOperationException
        Gets the as signature.
        Parameters:
        label - e.g. "java.lang.String.substring(int)" or "new java.lang.String()
        Returns:
        the given label as Signature
        Throws:
        java.lang.ReflectiveOperationException - the reflective operation exception
      • hasReturnType

        public static boolean hasReturnType​(org.aspectj.lang.Signature signature)
        Returns true if the given signature is a MethodSignature and the return value is not of type 'void'.
        Parameters:
        signature - the signature
        Returns:
        true, if successful
        Since:
        1.3.1