public class FileSystemDestination extends java.lang.Object implements GeneratorDestination
Modifier and Type | Field and Description |
---|---|
private java.io.File |
resourceDir |
private java.io.File |
sourceDir |
private java.util.List<SourceError> |
sourceErrors |
private java.util.List<SourceWarning> |
sourceWarnings |
Constructor and Description |
---|
FileSystemDestination(java.io.File resourceDir,
java.io.File sourceDir) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<SourceError> |
getErrors() |
java.io.Reader |
getResource(java.lang.String resourcePath)
Returns the Reader for the given resource.
|
java.util.Collection<SourceWarning> |
getWarnings() |
boolean |
hasErrors() |
boolean |
hasWarnings() |
java.io.Writer |
newClass(java.lang.String className)
Returns the Writer for the given class.
|
java.io.Writer |
newResource(java.lang.String resourcePath)
Returns the Writer for the given resource.
|
void |
printError(java.lang.String message)
Print the error.
|
void |
printError(java.lang.String message,
MetadataInfo element)
Print the error.
|
void |
printError(java.lang.String message,
java.lang.Throwable throwable)
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,
MetadataInfo element)
Print the warning.
|
void |
printWarning(java.lang.String message,
java.lang.Throwable throwable)
Print the warning.
|
private final java.io.File resourceDir
private final java.io.File sourceDir
private final java.util.List<SourceError> sourceErrors
private final java.util.List<SourceWarning> sourceWarnings
public FileSystemDestination(java.io.File resourceDir, java.io.File sourceDir)
public java.io.Writer newResource(java.lang.String resourcePath) throws java.io.IOException
GeneratorDestination
newResource
in interface GeneratorDestination
resourcePath
- resource pathjava.io.IOException
- if something wacked happenspublic java.io.Reader getResource(java.lang.String resourcePath) throws java.io.IOException
GeneratorDestination
getResource
in interface GeneratorDestination
resourcePath
- resource pathjava.io.IOException
- if something wacked happenspublic java.io.Writer newClass(java.lang.String className) throws java.io.IOException
GeneratorDestination
newClass
in interface GeneratorDestination
className
- class namejava.io.IOException
- if something wacked happenspublic void printError(java.lang.String message)
GeneratorDestination
printError
in interface GeneratorDestination
message
- error.public void printError(java.lang.String message, MetadataInfo element)
GeneratorDestination
printError
in interface GeneratorDestination
message
- error.element
- metadata element, to which this error is tailoredpublic void printError(java.lang.String message, java.lang.Throwable throwable)
GeneratorDestination
printError
in interface GeneratorDestination
message
- error.throwable
- exception causing the errorpublic boolean hasErrors()
public java.util.Collection<SourceError> getErrors()
public void printWarning(java.lang.String message)
GeneratorDestination
printWarning
in interface GeneratorDestination
message
- warning.public void printWarning(java.lang.String message, MetadataInfo element)
GeneratorDestination
printWarning
in interface GeneratorDestination
message
- warning.element
- metadata element, to which this error is tailoredpublic void printWarning(java.lang.String message, java.lang.Throwable throwable)
GeneratorDestination
printWarning
in interface GeneratorDestination
message
- warning.throwable
- exception causing the errorpublic boolean hasWarnings()
public java.util.Collection<SourceWarning> getWarnings()
public void printNote(java.lang.String message)
GeneratorDestination
printNote
in interface GeneratorDestination
message
- message.