Class GeneratedFile

java.lang.Object
org.mybatis.generator.api.GeneratedFile
Direct Known Subclasses:
GeneratedJavaFile, GeneratedKotlinFile, GeneratedXmlFile

public abstract class GeneratedFile extends Object
Abstract class that holds information common to all generated files.
Author:
Jeff Butler
  • Field Details

    • targetProject

      protected final String targetProject
  • Constructor Details

    • GeneratedFile

      protected GeneratedFile(String targetProject)
  • Method Details

    • getFormattedContent

      public abstract String getFormattedContent()
      Returns the entire contents of the generated file. Clients can simply save the value returned from this method as the file contents. Subclasses such as @see org.mybatis.generator.api.GeneratedJavaFile offer more fine grained access to file parts, but still implement this method in the event that the entire contents are desired.
      Returns:
      Returns the content.
    • getFileName

      public abstract String getFileName()
      Get the file name (without any path). Clients should use this method to determine how to save the results.
      Returns:
      Returns the file name.
    • getTargetProject

      public String getTargetProject()
      Gets the target project. Clients can call this method to determine how to save the results.
      Returns:
      the target project
    • getTargetPackage

      public abstract String getTargetPackage()
      Get the target package for the file. Clients should use this method to determine how to save the results.
      Returns:
      Returns the target project.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isMergeable

      public abstract boolean isMergeable()
      Checks if is mergeable.
      Returns:
      true, if is mergeable
    • getFileEncoding

      public abstract String getFileEncoding()