public static MethodAnnotation fromVisitedMethod ( PreorderVisitor visitor ) { String className = visitor . getDottedClassName ( ) ; MethodAnnotation result = new MethodAnnotation ( className , visitor . getMethodName ( ) , visitor . getMethodSig ( ) , visitor . getMethod ( ) . isStatic ( ) ) ; // Try to find the source lines for the method SourceLineAnnotation srcLines = SourceLineAnnotation . fromVisitedMethod ( visitor ) ; result . setSourceLines ( srcLines ) ; return result ; }
Factory method to create a MethodAnnotation from the method the given visitor is currently visiting .