class MockSourceGenerator
extends Object
Emits Java source files that stand in for the JDK types the Groovy Development
Kit enhances, so that groovydoc can process them as a normal source
tree. Each receiver type in the parsed DGM sources becomes one mock class:
instance methods for the typical case, static methods for sources whose class
name ends in StaticMethods or StaticExtensions.
Primitive and primitive-array receivers are emitted under legal identifier
names in a synthetic package (primitives); reference-array receivers
are emitted in the receiver's own package with a synthetic class name. The
true display name (such as int[]) is carried on the class-level
javadoc as a @displayName tag and read by an override template;
a post-process pass renames generated HTML paths back to the historical
URLs (e.g. primitives-and-primitive-arrays/int[].html).
| Type | Name and description |
|---|---|
static String |
MANIFEST_FILELines of fromRelPath\tdisplayPackage\tdisplayName written alongside
the mocks so PrimitiveNameRewriter can rename HTML output back to
historical URLs like primitives-and-primitive-arrays/int[].html. |
static String |
PRIMITIVES_PKG |
static List<String> |
PRIMITIVE_BASES |
| Constructor and description |
|---|
MockSourceGenerator(List<File> sourceFiles, File outputDir) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static String |
displayNameFor(String fqcn)Human-readable label used in
|
|
static String |
displayPackageFor(String fqcn, com.thoughtworks.qdox.model.JavaType type)Where the generated HTML page should live after rewriting (historical URL). |
|
void |
generateAll() |
|
static void |
main(String[] args) |
|
static String |
mockClassNameFor(String fqcn, com.thoughtworks.qdox.model.JavaType type)Legal Java identifier used as the mock class name for a top-level receiver. |
|
static String |
mockPackageFor(String fqcn, com.thoughtworks.qdox.model.JavaType type)Package the mock file lives in, derived from the receiver's FQCN. |
|
static String |
outerClassFqcn(String fqcn)If fqcn names a nested type (has an uppercase-starting segment that
isn't the last), returns the outer type's FQCN. |
|
static String |
resolveJdkClassName(String className) |
|
static String |
rewriteLinks(String text)Rewrites {@link #method(Recv, A, B)} to {@link Recv#method(A, B)}
— the first argument becomes the explicit class prefix, matching how
DocUtil.linkify operated in the original DocGenerator. |
Lines of fromRelPath\tdisplayPackage\tdisplayName written alongside
the mocks so PrimitiveNameRewriter can rename HTML output back to
historical URLs like primitives-and-primitive-arrays/int[].html.
Human-readable label used in
Where the generated HTML page should live after rewriting (historical URL).
Legal Java identifier used as the mock class name for a top-level receiver.
Package the mock file lives in, derived from the receiver's FQCN.
If fqcn names a nested type (has an uppercase-starting segment that
isn't the last), returns the outer type's FQCN. Otherwise returns null.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.