import org.objectweb.asm.ClassReader; //导入方法依赖的package包/类
/**
* Indicates whether the class held by the given reader is a candidate for extraction to
* an API class. Checks whether the class's package is in the list of packages
* explicitly exported by the library (if any), and whether the class should be
* included in the public API based on its visibility. If the list of exported
* packages is empty (e.g. the library has not declared an explicit {@code api {...}}
* specification, then package-private classes are included in the public API. If the
* list of exported packages is non-empty (i.e. the library has declared an
* {@code api {...}} specification, then package-private classes are excluded.
*
*
For these reasons, this method should be called as a test on every original
* .class file prior to invoking processed through
* {@link #extractApiClassFrom(ClassReader)}.
*
* @param originalClassReader the reader containing the original class to evaluate
* @return whether the given class is a candidate for API extraction
*/
public boolean shouldExtractApiClassFrom(ClassReader originalClassReader) {
if (!isCandidateApiMember(originalClassReader.getAccess(), apiIncludesPackagePrivateMembers)) {
return false;
}
String originalClassName = originalClassReader.getClassName();
if (isLocalClass(originalClassName)) {
return false;
}
return exportedPackages == null
|| exportedPackages.contains(packageNameOf(originalClassName));
}