Class FileSystemDestination

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • FileSystemDestination

        public FileSystemDestination​(java.io.File resourceDir,
                                     java.io.File sourceDir)
    • 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 interface GeneratorDestination
        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 interface GeneratorDestination
        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 interface GeneratorDestination
        Parameters:
        className - class name
        originatingClassName - 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 interface GeneratorDestination
        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 interface GeneratorDestination
        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 interface GeneratorDestination
        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 interface GeneratorDestination
        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 interface GeneratorDestination
        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 interface GeneratorDestination
        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 interface GeneratorDestination
        Parameters:
        message - message.