Class StringWriterOutputManager

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String initialPackageName  
      private java.lang.String packageName  
      private java.util.HashMap<java.lang.String,​java.io.StringWriter> sourceFileByName  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear all source files in this OutputManager and reset the initial package name.
      java.io.Writer createOutput​(java.lang.String name)
      Create a new output destination based on a name.
      java.lang.CharSequence getSource​(java.lang.String name)
      Get a CharSequence which represents the source file.
      java.util.Map<java.lang.String,​java.lang.CharSequence> getSources()
      Get a Map of all source files.
      void setPackageName​(java.lang.String packageName)
      Set the package name to be used for source files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • packageName

        private java.lang.String packageName
      • initialPackageName

        private java.lang.String initialPackageName
      • sourceFileByName

        private final java.util.HashMap<java.lang.String,​java.io.StringWriter> sourceFileByName
    • Constructor Detail

      • StringWriterOutputManager

        public StringWriterOutputManager()
    • Method Detail

      • createOutput

        public java.io.Writer createOutput​(java.lang.String name)
        Create a new output destination based on a name. The user is responsible for calling Writer.close().
        Specified by:
        createOutput in interface OutputManager
        Parameters:
        name - of the given output.
        Returns:
        A Writer to which the code generation should be output.
      • setPackageName

        public void setPackageName​(java.lang.String packageName)
        Set the package name to be used for source files.
        Specified by:
        setPackageName in interface DynamicPackageOutputManager
        Parameters:
        packageName - to be used for source files.
      • getSource

        public java.lang.CharSequence getSource​(java.lang.String name)
        Get a CharSequence which represents the source file.
        Parameters:
        name - of the source file.
        Returns:
        CharSequence which represents the source file.
      • getSources

        public java.util.Map<java.lang.String,​java.lang.CharSequence> getSources()
        Get a Map of all source files.
        Returns:
        a Map of all source files.
      • clear

        public void clear()
        Clear all source files in this OutputManager and reset the initial package name.