Class FileSystemDestination

java.lang.Object
org.openjdk.jmh.generators.core.FileSystemDestination
All Implemented Interfaces:
GeneratorDestination

public class FileSystemDestination extends Object implements GeneratorDestination
  • Field Details

    • resourceDir

      private final File resourceDir
    • sourceDir

      private final File sourceDir
    • sourceErrors

      private final List<SourceError> sourceErrors
    • sourceWarnings

      private final List<SourceWarning> sourceWarnings
  • Constructor Details

    • FileSystemDestination

      public FileSystemDestination(File resourceDir, File sourceDir)
  • Method Details

    • newResource

      public OutputStream newResource(String resourcePath) throws IOException
      Description copied from interface: GeneratorDestination
      Returns the stream for the given resource. Callers are responsible for closing streams.
      Specified by:
      newResource in interface GeneratorDestination
      Parameters:
      resourcePath - resource path
      Returns:
      output stream to write the resource to.
      Throws:
      IOException - if something wacked happens
    • getResource

      public InputStream getResource(String resourcePath) throws IOException
      Description copied from interface: GeneratorDestination
      Returns the stream for the given resource. Callers are responsible for closing streams.
      Specified by:
      getResource in interface GeneratorDestination
      Parameters:
      resourcePath - resource path
      Returns:
      stream usable to read the resource
      Throws:
      IOException - if something wacked happens
    • newClass

      public Writer newClass(String className, String originatingClassName) throws IOException
      Description copied from interface: GeneratorDestination
      Returns the Writer for the given class. Callers are responsible for closing Writers.
      Specified by:
      newClass in interface GeneratorDestination
      Parameters:
      className - class name
      originatingClassName - class name causing the creation of this class
      Returns:
      writer usable to write the resource
      Throws:
      IOException - if something wacked happens
    • printError

      public void printError(String message)
      Description copied from interface: GeneratorDestination
      Print the error. Calling this method should not terminate anything.
      Specified by:
      printError in interface GeneratorDestination
      Parameters:
      message - error.
    • printError

      public void printError(String message, MetadataInfo element)
      Description copied from interface: GeneratorDestination
      Print the error. Calling this method should not terminate anything.
      Specified by:
      printError in interface GeneratorDestination
      Parameters:
      message - error.
      element - metadata element, to which this error is tailored
    • printError

      public void printError(String message, Throwable throwable)
      Description copied from interface: GeneratorDestination
      Print the error. Calling this method should not terminate anything.
      Specified by:
      printError in interface GeneratorDestination
      Parameters:
      message - error.
      throwable - exception causing the error
    • hasErrors

      public boolean hasErrors()
    • getErrors

      public Collection<SourceError> getErrors()
    • printWarning

      public void printWarning(String message)
      Description copied from interface: GeneratorDestination
      Print the warning. Calling this method should not terminate anything.
      Specified by:
      printWarning in interface GeneratorDestination
      Parameters:
      message - warning.
    • printWarning

      public void printWarning(String message, MetadataInfo element)
      Description copied from interface: GeneratorDestination
      Print the warning. Calling this method should not terminate anything.
      Specified by:
      printWarning in interface GeneratorDestination
      Parameters:
      message - warning.
      element - metadata element, to which this error is tailored
    • printWarning

      public void printWarning(String message, Throwable throwable)
      Description copied from interface: GeneratorDestination
      Print the warning. Calling this method should not terminate anything.
      Specified by:
      printWarning in interface GeneratorDestination
      Parameters:
      message - warning.
      throwable - exception causing the error
    • hasWarnings

      public boolean hasWarnings()
    • getWarnings

      public Collection<SourceWarning> getWarnings()
    • printNote

      public void printNote(String message)
      Description copied from interface: GeneratorDestination
      Print the informative message. Calling this method should not terminate anything.
      Specified by:
      printNote in interface GeneratorDestination
      Parameters:
      message - message.