Class BatchEnvironment

  • All Implemented Interfaces:
    Constants, RuntimeConstants, ErrorConsumer
    Direct Known Subclasses:
    BatchEnvironment

    public class BatchEnvironment
    extends BatchEnvironment
    BatchEnvironment for rmic extends javac's version in four ways: 1. It overrides errorString() to handle looking for rmic-specific error messages in rmic's resource bundle 2. It provides a mechanism for recording intermediate generated files so that they can be deleted later. 3. It holds a reference to the Main instance so that generators can refer to it. 4. It provides access to the ClassPath passed to the constructor. 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

      • destinationDir

        private java.io.File destinationDir
        The directory to which class files are being written.
      • generatedFiles

        private java.util.Vector<java.io.File> generatedFiles
        list of generated source files created in this environment
    • Constructor Detail

      • BatchEnvironment

        public BatchEnvironment​(java.io.OutputStream out,
                                ClassPath path,
                                java.io.File destinationDir)
        Create a BatchEnvironment for rmic with the given class path, stream for messages and destination directory.
    • Method Detail

      • createClassPath

        public static ClassPath createClassPath​(java.lang.String classPathString,
                                                java.lang.String sysClassPathString)
        Create a ClassPath object for rmic from the relevant command line options for class path and boot class path.
      • getDestinationDir

        public java.io.File getDestinationDir()
        Returns the directory to which generated classes will be written.
        Returns:
        the destination directory specified by the "-d" flag
      • getClassPath

        public ClassPath getClassPath()
        Get the ClassPath.
      • addGeneratedFile

        public void addGeneratedFile​(java.io.File file)
        Remember a generated source file generated so that it can be removed later, if appropriate.
      • deleteGeneratedFiles

        void deleteGeneratedFiles()
        Delete all the generated source files made during the execution of this environment (those that have been registered with the "addGeneratedFile" method).
      • errorString

        public java.lang.String errorString​(java.lang.String err,
                                            java.lang.Object arg0,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2)
        Return the formatted, localized string for a named error message and supplied arguments. For rmic error messages, with names that being with "rmic.", look up the error message in rmic's resource bundle; otherwise, defer to java's superclass method.
        Overrides:
        errorString in class BatchEnvironment
      • reset

        public void reset()