Class Weaver


  • public final class Weaver
    extends java.lang.Object
    See Also:
    Weave
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T callOriginal()
      Invoke the original method implementation of a weaved method.
      static <T extends java.lang.annotation.Annotation>
      T
      getClassAnnotation​(java.lang.Class<T> annotationClass)
      Returns a view of the provided annotation if it is present on the current class.
      static java.lang.String getImplementationTitle()
      Get the name of the weave package.
      static <T extends java.lang.annotation.Annotation>
      T
      getMethodAnnotation​(java.lang.Class<T> annotationClass)
      Returns a view of the provided annotation if it is present on the current method.
      • Methods inherited from class java.lang.Object

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

      • callOriginal

        public static final <T> T callOriginal()
        Invoke the original method implementation of a weaved method. This call is replaced with the original method body.
        Returns:
      • getImplementationTitle

        public static final java.lang.String getImplementationTitle()
        Get the name of the weave package. This is the name defined in the weave package's manifest file (attribute Implementation-Title).
        Returns:
      • getClassAnnotation

        public static final <T extends java.lang.annotation.Annotation> T getClassAnnotation​(java.lang.Class<T> annotationClass)
        Returns a view of the provided annotation if it is present on the current class. If no annotation matching the provided class is present then null will be returned.
        Parameters:
        annotationClass - the class of annotation to look for
        Returns:
        the annotation, if present on the class, null otherwise
      • getMethodAnnotation

        public static final <T extends java.lang.annotation.Annotation> T getMethodAnnotation​(java.lang.Class<T> annotationClass)
        Returns a view of the provided annotation if it is present on the current method. If no annotation that matches the provided annotationClass is present then null will be returned.
        Parameters:
        annotationClass - the class of annotation to look for
        Returns:
        the annotation, if present on the method, null otherwise