Package org.apache.maven.jxr
Class JXR
java.lang.Object
org.apache.maven.jxr.JXR
Main entry point into Maven used to kick off the XReference code building.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]The default list of include patterns to use.private PathPath to destination.private String[]The list of exclude patterns to use.private String[]The list of include patterns to use.private Stringprivate PathRelative path to javadocs, suitable for hyperlinking.private Localeprivate static final org.slf4j.Loggerprivate Stringprivate final PackageManagerprivate StringThe revision of the module currently being processed.private final JavaCodeTransformHandles taking .java files and changing them into html. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static PathgetRelativeLink(Path fromDir, Path toDir) Creates a relative link from one directory to another.static booleanisHtmlFile(String filename) Checks to see if the file is an HTML file.static booleanisJavaFile(String filename) Check to see if the file is a Java source file.voidprocessPath(PackageManager packageManager, Path sourceDir, String bottom) Now that we have instantiated everything.voidSets the destination.voidsetExcludes(String[] excludes) voidsetIncludes(String[] includes) voidsetInputEncoding(String inputEncoding) Sets the input encoding.voidsetJavadocLinkDir(Path javadocLinkDir) Sets the relative path to javadocs.voidSets the locale.voidsetOutputEncoding(String outputEncoding) Sets the output encoding.voidsetRevision(String revision) Sets the revision.private voidGiven a source file transform it into HTML and write it to the destination (dest) file.voidxref(List<String> sourceDirs, String templateDir, String windowTitle, String docTitle, String bottom) Performs the cross-referencing.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
pkgmgr
-
transformer
Handles taking .java files and changing them into html. "More than meets the eye!" :) -
DEFAULT_INCLUDES
The default list of include patterns to use. -
destDir
Path to destination. -
locale
-
inputEncoding
-
outputEncoding
-
javadocLinkDir
Relative path to javadocs, suitable for hyperlinking. -
revision
The revision of the module currently being processed. -
excludes
The list of exclude patterns to use. -
includes
The list of include patterns to use.
-
-
Constructor Details
-
JXR
-
-
Method Details
-
processPath
public void processPath(PackageManager packageManager, Path sourceDir, String bottom) throws IOException Now that we have instantiated everything. Process this JXR task.- Parameters:
packageManager- package managersourceDir- source directory.bottom- bottom text- Throws:
IOException- on transformation error
-
isJavaFile
Check to see if the file is a Java source file.- Parameters:
filename- The name of the file to check- Returns:
trueif the file is a Java file
-
isHtmlFile
Checks to see if the file is an HTML file.- Parameters:
filename- The name of the file to check- Returns:
trueif the file is an HTML file
-
setDest
Sets the destination.- Parameters:
dest- destination
-
setLocale
Sets the locale.- Parameters:
locale- locale
-
setInputEncoding
Sets the input encoding.- Parameters:
inputEncoding- input encoding
-
setOutputEncoding
Sets the output encoding.- Parameters:
outputEncoding- output encoding
-
setJavadocLinkDir
Sets the relative path to javadocs.- Parameters:
javadocLinkDir- path to javadocs
-
setRevision
Sets the revision.- Parameters:
revision- revision
-
xref
public void xref(List<String> sourceDirs, String templateDir, String windowTitle, String docTitle, String bottom) throws IOException, JxrException Performs the cross-referencing.- Parameters:
sourceDirs- source directoriestemplateDir- template directorywindowTitle- window titledocTitle- document titlebottom- bottom text- Throws:
IOException- on I/O errorJxrException- on Velocity error
-
transform
Given a source file transform it into HTML and write it to the destination (dest) file.- Parameters:
sourceFile- The java source filedestFile- The directory to put the HTML intobottom- The bottom footer text just as in the package pages- Throws:
IOException- if the transform can't happen for some reason
-
getRelativeLink
Creates a relative link from one directory to another. Example: given/foo/bar/baz/oinkand/foo/bar/schmoothis method will return a string of"../../schmoo/"- Parameters:
fromDir- The directory from which the link is relative.toDir- The directory into which the link points.- Returns:
- a String of format
"../../schmoo/"
-
setExcludes
-
setIncludes
-