Package org.apache.maven.jxr
Class JXR
- java.lang.Object
-
- org.apache.maven.jxr.JXR
-
public class JXR extends java.lang.ObjectMain entry point into Maven used to kick off the XReference code building.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]DEFAULT_INCLUDESThe default list of include patterns to use.private java.nio.file.PathdestDirPath to destination.private java.lang.String[]excludesThe list of exclude patterns to use.private java.lang.String[]includesThe list of include patterns to use.private java.lang.StringinputEncodingprivate java.nio.file.PathjavadocLinkDirRelative path to javadocs, suitable for hyperlinking.private java.util.Localelocaleprivate static org.slf4j.LoggerLOGGERprivate java.lang.StringoutputEncodingprivate PackageManagerpkgmgrprivate java.lang.StringrevisionThe revision of the module currently being processed.private JavaCodeTransformtransformerHandles taking .java files and changing them into html.
-
Constructor Summary
Constructors Constructor Description JXR(PackageManager pkgmgr, JavaCodeTransform transformer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.nio.file.PathgetRelativeLink(java.nio.file.Path fromDir, java.nio.file.Path toDir)Creates a relative link from one directory to another.static booleanisHtmlFile(java.lang.String filename)Checks to see if the file is an HTML file.static booleanisJavaFile(java.lang.String filename)Check to see if the file is a Java source file.voidprocessPath(PackageManager packageManager, java.nio.file.Path sourceDir, java.lang.String bottom)Now that we have instantiated everything.voidsetDest(java.nio.file.Path dest)Sets the destination.voidsetExcludes(java.lang.String[] excludes)voidsetIncludes(java.lang.String[] includes)voidsetInputEncoding(java.lang.String inputEncoding)Sets the input encoding.voidsetJavadocLinkDir(java.nio.file.Path javadocLinkDir)Sets the relative path to javadocs.voidsetLocale(java.util.Locale locale)Sets the locale.voidsetOutputEncoding(java.lang.String outputEncoding)Sets the output encoding.voidsetRevision(java.lang.String revision)Sets the revision.private voidtransform(java.nio.file.Path sourceFile, java.nio.file.Path destFile, java.lang.String bottom)Given a source file transform it into HTML and write it to the destination (dest) file.voidxref(java.util.List<java.lang.String> sourceDirs, java.lang.String templateDir, java.lang.String windowTitle, java.lang.String docTitle, java.lang.String bottom)Performs the cross-referencing.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
pkgmgr
private final PackageManager pkgmgr
-
transformer
private final JavaCodeTransform transformer
Handles taking .java files and changing them into html. "More than meets the eye!" :)
-
DEFAULT_INCLUDES
private static final java.lang.String[] DEFAULT_INCLUDES
The default list of include patterns to use.
-
destDir
private java.nio.file.Path destDir
Path to destination.
-
locale
private java.util.Locale locale
-
inputEncoding
private java.lang.String inputEncoding
-
outputEncoding
private java.lang.String outputEncoding
-
javadocLinkDir
private java.nio.file.Path javadocLinkDir
Relative path to javadocs, suitable for hyperlinking.
-
revision
private java.lang.String revision
The revision of the module currently being processed.
-
excludes
private java.lang.String[] excludes
The list of exclude patterns to use.
-
includes
private java.lang.String[] includes
The list of include patterns to use.
-
-
Constructor Detail
-
JXR
public JXR(PackageManager pkgmgr, JavaCodeTransform transformer)
-
-
Method Detail
-
processPath
public void processPath(PackageManager packageManager, java.nio.file.Path sourceDir, java.lang.String bottom) throws java.io.IOException
Now that we have instantiated everything. Process this JXR task.- Parameters:
packageManager- package managersourceDir- source directory.bottom- bottom text- Throws:
java.io.IOException- on transformation error
-
isJavaFile
public static boolean isJavaFile(java.lang.String filename)
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
public static boolean isHtmlFile(java.lang.String filename)
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
public void setDest(java.nio.file.Path dest)
Sets the destination.- Parameters:
dest- destination
-
setLocale
public void setLocale(java.util.Locale locale)
Sets the locale.- Parameters:
locale- locale
-
setInputEncoding
public void setInputEncoding(java.lang.String inputEncoding)
Sets the input encoding.- Parameters:
inputEncoding- input encoding
-
setOutputEncoding
public void setOutputEncoding(java.lang.String outputEncoding)
Sets the output encoding.- Parameters:
outputEncoding- output encoding
-
setJavadocLinkDir
public void setJavadocLinkDir(java.nio.file.Path javadocLinkDir)
Sets the relative path to javadocs.- Parameters:
javadocLinkDir- path to javadocs
-
setRevision
public void setRevision(java.lang.String revision)
Sets the revision.- Parameters:
revision- revision
-
xref
public void xref(java.util.List<java.lang.String> sourceDirs, java.lang.String templateDir, java.lang.String windowTitle, java.lang.String docTitle, java.lang.String bottom) throws java.io.IOException, JxrExceptionPerforms the cross-referencing.- Parameters:
sourceDirs- source directoriestemplateDir- template directorywindowTitle- window titledocTitle- document titlebottom- bottom text- Throws:
java.io.IOException- on I/O errorJxrException- on Velocity error
-
transform
private void transform(java.nio.file.Path sourceFile, java.nio.file.Path destFile, java.lang.String bottom) throws java.io.IOExceptionGiven 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:
java.io.IOException- if the transform can't happen for some reason
-
getRelativeLink
private static java.nio.file.Path getRelativeLink(java.nio.file.Path fromDir, java.nio.file.Path toDir)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
public void setExcludes(java.lang.String[] excludes)
-
setIncludes
public void setIncludes(java.lang.String[] includes)
-
-