Package org.openjdk.jmh.generators.core
Class FileSystemDestination
- java.lang.Object
-
- org.openjdk.jmh.generators.core.FileSystemDestination
-
- All Implemented Interfaces:
GeneratorDestination
public class FileSystemDestination extends java.lang.Object implements GeneratorDestination
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
resourceDir
private java.io.File
sourceDir
private java.util.List<SourceError>
sourceErrors
private java.util.List<SourceWarning>
sourceWarnings
-
Constructor Summary
Constructors Constructor Description FileSystemDestination(java.io.File resourceDir, java.io.File sourceDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<SourceError>
getErrors()
java.io.InputStream
getResource(java.lang.String resourcePath)
Returns the stream for the given resource.java.util.Collection<SourceWarning>
getWarnings()
boolean
hasErrors()
boolean
hasWarnings()
java.io.Writer
newClass(java.lang.String className, java.lang.String originatingClassName)
Returns the Writer for the given class.java.io.OutputStream
newResource(java.lang.String resourcePath)
Returns the stream for the given resource.void
printError(java.lang.String message)
Print the error.void
printError(java.lang.String message, java.lang.Throwable throwable)
Print the error.void
printError(java.lang.String message, MetadataInfo element)
Print the error.void
printNote(java.lang.String message)
Print the informative message.void
printWarning(java.lang.String message)
Print the warning.void
printWarning(java.lang.String message, java.lang.Throwable throwable)
Print the warning.void
printWarning(java.lang.String message, MetadataInfo element)
Print the warning.
-
-
-
Field Detail
-
resourceDir
private final java.io.File resourceDir
-
sourceDir
private final java.io.File sourceDir
-
sourceErrors
private final java.util.List<SourceError> sourceErrors
-
sourceWarnings
private final java.util.List<SourceWarning> sourceWarnings
-
-
Method Detail
-
newResource
public java.io.OutputStream newResource(java.lang.String resourcePath) throws java.io.IOException
Description copied from interface:GeneratorDestination
Returns the stream for the given resource. Callers are responsible for closing streams.- Specified by:
newResource
in interfaceGeneratorDestination
- Parameters:
resourcePath
- resource path- Returns:
- output stream to write the resource to.
- Throws:
java.io.IOException
- if something wacked happens
-
getResource
public java.io.InputStream getResource(java.lang.String resourcePath) throws java.io.IOException
Description copied from interface:GeneratorDestination
Returns the stream for the given resource. Callers are responsible for closing streams.- Specified by:
getResource
in interfaceGeneratorDestination
- Parameters:
resourcePath
- resource path- Returns:
- stream usable to read the resource
- Throws:
java.io.IOException
- if something wacked happens
-
newClass
public java.io.Writer newClass(java.lang.String className, java.lang.String originatingClassName) throws java.io.IOException
Description copied from interface:GeneratorDestination
Returns the Writer for the given class. Callers are responsible for closing Writers.- Specified by:
newClass
in interfaceGeneratorDestination
- Parameters:
className
- class nameoriginatingClassName
- class name causing the creation of this class- Returns:
- writer usable to write the resource
- Throws:
java.io.IOException
- if something wacked happens
-
printError
public void printError(java.lang.String message)
Description copied from interface:GeneratorDestination
Print the error. Calling this method should not terminate anything.- Specified by:
printError
in interfaceGeneratorDestination
- Parameters:
message
- error.
-
printError
public void printError(java.lang.String message, MetadataInfo element)
Description copied from interface:GeneratorDestination
Print the error. Calling this method should not terminate anything.- Specified by:
printError
in interfaceGeneratorDestination
- Parameters:
message
- error.element
- metadata element, to which this error is tailored
-
printError
public void printError(java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:GeneratorDestination
Print the error. Calling this method should not terminate anything.- Specified by:
printError
in interfaceGeneratorDestination
- Parameters:
message
- error.throwable
- exception causing the error
-
hasErrors
public boolean hasErrors()
-
getErrors
public java.util.Collection<SourceError> getErrors()
-
printWarning
public void printWarning(java.lang.String message)
Description copied from interface:GeneratorDestination
Print the warning. Calling this method should not terminate anything.- Specified by:
printWarning
in interfaceGeneratorDestination
- Parameters:
message
- warning.
-
printWarning
public void printWarning(java.lang.String message, MetadataInfo element)
Description copied from interface:GeneratorDestination
Print the warning. Calling this method should not terminate anything.- Specified by:
printWarning
in interfaceGeneratorDestination
- Parameters:
message
- warning.element
- metadata element, to which this error is tailored
-
printWarning
public void printWarning(java.lang.String message, java.lang.Throwable throwable)
Description copied from interface:GeneratorDestination
Print the warning. Calling this method should not terminate anything.- Specified by:
printWarning
in interfaceGeneratorDestination
- Parameters:
message
- warning.throwable
- exception causing the error
-
hasWarnings
public boolean hasWarnings()
-
getWarnings
public java.util.Collection<SourceWarning> getWarnings()
-
printNote
public void printNote(java.lang.String message)
Description copied from interface:GeneratorDestination
Print the informative message. Calling this method should not terminate anything.- Specified by:
printNote
in interfaceGeneratorDestination
- Parameters:
message
- message.
-
-