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 Details

    • destinationDir

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

      private Vector<File> generatedFiles
      list of generated source files created in this environment
  • Constructor Details

    • BatchEnvironment

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

    • createClassPath

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

      public 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(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).
    • shutdown

      public void shutdown()
      Release resources, if any.
      Overrides:
      shutdown in class BatchEnvironment
    • errorString

      public String errorString(String err, Object arg0, Object arg1, 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()