public static Matcher < MethodTree > constructorOfClass ( final String className ) { return new Matcher < MethodTree > ( ) { @ Override public boolean matches ( MethodTree methodTree , VisitorState state ) { Symbol symbol = ASTHelpers . getSymbol ( methodTree ) ; return symbol . getEnclosingElement ( ) . getQualifiedName ( ) . contentEquals ( className ) && symbol . isConstructor ( ) ; } } ; }
Matches a constructor declaration in a specific enclosing class .