public boolean matches ( Class < ? > clazz ) { // fully qualified import? if ( this . target . equals ( clazz . getName ( ) ) ) { return true ; } // wild card imports if ( this . target . endsWith ( ".*" ) ) { String prefix = this . target . substring ( 0 , this . target . indexOf ( ".*" ) ) ; // package import: import my.package.* if ( prefix . equals ( clazz . getPackage ( ) . getName ( ) ) ) { return true ; } // inner class imports with wild card? // by looking at the ClassTypeResolver class, it seems we do not support // the usage of wild cards when importing static inner classes like the // java static imports allow } return false ; }
Returns true if this ImportDeclaration correctly matches to the given clazz