Package jdiff

Class Options


  • public class Options
    extends java.lang.Object
    Class to handle options for JDiff. See the file LICENSE.txt for copyright details.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String cmdOptions
      All the options passed on the command line.
    • Constructor Summary

      Constructors 
      Constructor Description
      Options()
      Default constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int optionLength​(java.lang.String option)
      Returns the "length" of a given option.
      static void usage()
      Display the arguments for JDiff.
      static boolean validOptions​(java.lang.String[][] options, com.sun.javadoc.DocErrorReporter reporter)
      After parsing the available options using optionLength(java.lang.String), Javadoc invokes this method with an array of options-arrays, where the first item in any array is the option, and subsequent items in that array are its arguments.
      • Methods inherited from class java.lang.Object

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

      • cmdOptions

        public static java.lang.String cmdOptions
        All the options passed on the command line. Logged to XML.
    • Constructor Detail

      • Options

        public Options()
        Default constructor.
    • Method Detail

      • optionLength

        public static int optionLength​(java.lang.String option)
        Returns the "length" of a given option. If an option takes no arguments, its length is one. If it takes one argument, its length is two, and so on. This method is called by Javadoc to parse the options it does not recognize. It then calls validOptions(java.lang.String[][], com.sun.javadoc.DocErrorReporter) to validate them.
        Note:
        The options arrive as case-sensitive strings. For options that are not case-sensitive, use toLowerCase() on the option string before comparing it.
        Parameters:
        option - a String containing an option
        Returns:
        an int telling how many components that option has
      • validOptions

        public static boolean validOptions​(java.lang.String[][] options,
                                           com.sun.javadoc.DocErrorReporter reporter)
        After parsing the available options using optionLength(java.lang.String), Javadoc invokes this method with an array of options-arrays, where the first item in any array is the option, and subsequent items in that array are its arguments. So, if -print is an option that takes no arguments, and -copies is an option that takes 1 argument, then
             -print -copies 3
         
        produces an array of arrays that looks like:
              option[0][0] = -print
              option[1][0] = -copies
              option[1][1] = 3
         
        (By convention, command line switches start with a "-", but they don't have to.)

        Note:
        Javadoc passes allparameters to this method, not just those that Javadoc doesn't recognize. The only way to identify unexpected arguments is therefore to check for every Javadoc parameter as well as doclet parameters.

        Parameters:
        options - an array of String arrays, one per option
        reporter - a DocErrorReporter for generating error messages
        Returns:
        true if no errors were found, and all options are valid
      • usage

        public static void usage()
        Display the arguments for JDiff.