Class JXR

java.lang.Object
org.apache.maven.jxr.JXR

public class JXR extends Object
Main entry point into Maven used to kick off the XReference code building.
  • Field Details

    • 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 String[] DEFAULT_INCLUDES
      The default list of include patterns to use.
    • destDir

      private Path destDir
      Path to destination.
    • locale

      private Locale locale
    • inputEncoding

      private String inputEncoding
    • outputEncoding

      private String outputEncoding
    • javadocLinkDir

      private Path javadocLinkDir
      Relative path to javadocs, suitable for hyperlinking.
    • revision

      private String revision
      The revision of the module currently being processed.
    • excludes

      private String[] excludes
      The list of exclude patterns to use.
    • includes

      private String[] includes
      The list of include patterns to use.
  • Constructor Details

  • 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 manager
      sourceDir - source directory.
      bottom - bottom text
      Throws:
      IOException - on transformation error
    • isJavaFile

      public static boolean isJavaFile(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(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(Path dest)
      Sets the destination.
      Parameters:
      dest - destination
    • setLocale

      public void setLocale(Locale locale)
      Sets the locale.
      Parameters:
      locale - locale
    • setInputEncoding

      public void setInputEncoding(String inputEncoding)
      Sets the input encoding.
      Parameters:
      inputEncoding - input encoding
    • setOutputEncoding

      public void setOutputEncoding(String outputEncoding)
      Sets the output encoding.
      Parameters:
      outputEncoding - output encoding
    • setJavadocLinkDir

      public void setJavadocLinkDir(Path javadocLinkDir)
      Sets the relative path to javadocs.
      Parameters:
      javadocLinkDir - path to javadocs
    • setRevision

      public void setRevision(String revision)
      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 directories
      templateDir - template directory
      windowTitle - window title
      docTitle - document title
      bottom - bottom text
      Throws:
      IOException - on I/O error
      JxrException - on Velocity error
    • transform

      private void transform(Path sourceFile, Path destFile, String bottom) throws 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:
      IOException - if the transform can't happen for some reason
    • getRelativeLink

      private static Path getRelativeLink(Path fromDir, 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(String[] excludes)
    • setIncludes

      public void setIncludes(String[] includes)