Class JXR


  • public class JXR
    extends java.lang.Object
    Main 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_INCLUDES
      The default list of include patterns to use.
      private java.nio.file.Path destDir
      Path to destination.
      private java.lang.String[] excludes
      The list of exclude patterns to use.
      private java.lang.String[] includes
      The list of include patterns to use.
      private java.lang.String inputEncoding  
      private java.nio.file.Path javadocLinkDir
      Relative path to javadocs, suitable for hyperlinking.
      private java.util.Locale locale  
      private static org.slf4j.Logger LOGGER  
      private java.lang.String outputEncoding  
      private PackageManager pkgmgr  
      private java.lang.String revision
      The revision of the module currently being processed.
      private JavaCodeTransform transformer
      Handles taking .java files and changing them into html.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      static boolean isHtmlFile​(java.lang.String filename)
      Checks to see if the file is an HTML file.
      static boolean isJavaFile​(java.lang.String filename)
      Check to see if the file is a Java source file.
      void processPath​(PackageManager packageManager, java.nio.file.Path sourceDir, java.lang.String bottom)
      Now that we have instantiated everything.
      void setDest​(java.nio.file.Path dest)
      Sets the destination.
      void setExcludes​(java.lang.String[] excludes)  
      void setIncludes​(java.lang.String[] includes)  
      void setInputEncoding​(java.lang.String inputEncoding)
      Sets the input encoding.
      void setJavadocLinkDir​(java.nio.file.Path javadocLinkDir)
      Sets the relative path to javadocs.
      void setLocale​(java.util.Locale locale)
      Sets the locale.
      void setOutputEncoding​(java.lang.String outputEncoding)
      Sets the output encoding.
      void setRevision​(java.lang.String revision)
      Sets the revision.
      private void transform​(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.
      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)
      Performs the cross-referencing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • 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.
    • 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 manager
        sourceDir - 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:
        true if 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:
        true if 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,
                         JxrException
        Performs the cross-referencing.
        Parameters:
        sourceDirs - source directories
        templateDir - template directory
        windowTitle - window title
        docTitle - document title
        bottom - bottom text
        Throws:
        java.io.IOException - on I/O error
        JxrException - on Velocity error
      • transform

        private void transform​(java.nio.file.Path sourceFile,
                               java.nio.file.Path destFile,
                               java.lang.String bottom)
                        throws java.io.IOException
        Given a source file transform it into HTML and write it to the destination (dest) file.
        Parameters:
        sourceFile - The java source file
        destFile - The directory to put the HTML into
        bottom - 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/oink and /foo/bar/schmoo this 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)