Class Main

  • All Implemented Interfaces:
    Constants, Constants, RuntimeConstants
    Direct Known Subclasses:
    Main

    public class Main
    extends java.lang.Object
    implements Constants
    Main "rmic" program. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
    • Field Detail

      • sourcePathArg

        java.lang.String sourcePathArg
      • sysClassPathArg

        java.lang.String sysClassPathArg
      • classPathString

        java.lang.String classPathString
      • destDir

        java.io.File destDir
      • flags

        int flags
      • tm

        long tm
      • classes

        java.util.Vector<java.lang.String> classes
      • nowrite

        boolean nowrite
      • nocompile

        boolean nocompile
      • keepGenerated

        boolean keepGenerated
      • status

        boolean status
      • generatorArgs

        java.lang.String[] generatorArgs
      • generators

        java.util.Vector<Generator> generators
      • iiopGeneration

        boolean iiopGeneration
      • program

        java.lang.String program
        Name of the program.
      • out

        java.io.OutputStream out
        The stream where error message are printed.
      • resourcesInitialized

        private static boolean resourcesInitialized
      • resources

        private static java.util.ResourceBundle resources
      • resourcesExt

        private static java.util.ResourceBundle resourcesExt
    • Constructor Detail

      • Main

        public Main​(java.io.OutputStream out,
                    java.lang.String program)
        Constructor.
    • Method Detail

      • output

        public void output​(java.lang.String msg)
        Output a message.
      • error

        public void error​(java.lang.String msg)
        Top level error message. This method is called when the environment could not be set up yet.
      • error

        public void error​(java.lang.String msg,
                          java.lang.String arg1)
      • error

        public void error​(java.lang.String msg,
                          java.lang.String arg1,
                          java.lang.String arg2)
      • usage

        public void usage()
        Usage
      • compile

        public boolean compile​(java.lang.String[] argv)
        Run the compiler
      • getDestinationDir

        public java.io.File getDestinationDir()
        Get the destination directory.
      • parseArgs

        public boolean parseArgs​(java.lang.String... argv)
        Parse the arguments for compile.
      • checkGeneratorArg

        protected boolean checkGeneratorArg​(java.lang.String[] argv,
                                            int currentIndex)
        If this argument is for a generator, instantiate it, call parseArgs(...) and add generator to generators vector. Returns false on error.
      • addGenerator

        protected Generator addGenerator​(java.lang.String arg)
        Instantiate and add a generator to the generators array.
      • getArray

        protected java.lang.String[] getArray​(java.lang.String name,
                                              boolean mustExist)
        Grab a resource string and parse it into an array of strings. Assumes comma separated list.
        Parameters:
        name - The resource name.
        mustExist - If true, throws error if resource does not exist. If false and resource does not exist, returns zero element array.
      • getEnv

        public BatchEnvironment getEnv()
        Get the correct type of BatchEnvironment
      • doCompile

        private boolean doCompile()
        Do the compile with the switches and files already supplied
      • getErrorSummary

        private java.lang.String getErrorSummary​(BatchEnvironment env)
      • getWarningSummary

        private java.lang.String getWarningSummary​(BatchEnvironment env)
      • compileAllClasses

        public void compileAllClasses​(BatchEnvironment env)
                               throws ClassNotFound,
                                      java.io.IOException,
                                      java.lang.InterruptedException
        Throws:
        ClassNotFound
        java.io.IOException
        java.lang.InterruptedException
      • main

        public static void main​(java.lang.String[] argv)
        Main program
      • getString

        public static java.lang.String getString​(java.lang.String key)
        Return the string value of a named resource in the rmic.properties resource bundle. If the resource is not found, null is returned.
      • initResources

        private static void initResources()
      • getText

        public static java.lang.String getText​(java.lang.String key)
      • getText

        public static java.lang.String getText​(java.lang.String key,
                                               int num)
      • getText

        public static java.lang.String getText​(java.lang.String key,
                                               java.lang.String arg0)
      • getText

        public static java.lang.String getText​(java.lang.String key,
                                               java.lang.String arg0,
                                               java.lang.String arg1)
      • getText

        public static java.lang.String getText​(java.lang.String key,
                                               java.lang.String arg0,
                                               java.lang.String arg1,
                                               java.lang.String arg2)
      • getGeneratedClassNames

        java.lang.String[] getGeneratedClassNames​(BatchEnvironment environment)