Class SourceParserKit
java.lang.Object
com.iohao.net.common.kit.source.SourceParserKit
Utility for parsing Java source files using the JDK Compiler Tree API.
Extracts Javadoc comments, line numbers, annotations, and enum constant arguments.
- Author:
- 渔民小镇
- date:
- 2025-02-27
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseClass(String fqcn, File... roots) Parse source files and return a single class by fully qualified name.parseSourceTree(File... roots) Parse all.javafiles under the given roots and return a map of fully qualified class name toSourceClass.
-
Constructor Details
-
SourceParserKit
public SourceParserKit()
-
-
Method Details
-
parseSourceTree
Parse all.javafiles under the given roots and return a map of fully qualified class name toSourceClass.- Parameters:
roots- source directories or single.javafiles- Returns:
- map keyed by fully qualified class name
-
parseClass
Parse source files and return a single class by fully qualified name.- Parameters:
fqcn- fully qualified class nameroots- source directories or single.javafiles- Returns:
- the parsed class, or an empty
SourceClassif not found
-