public class

GeneratedJavaFile

extends GeneratedFile
java.lang.Object
   ↳ org.mybatis.generator.api.GeneratedFile
     ↳ org.mybatis.generator.api.GeneratedJavaFile

Summary

Public Constructors
GeneratedJavaFile(CompilationUnit compilationUnit, String targetProject)
Default constructor
Public Methods
CompilationUnit getCompilationUnit()
This method is required by the Eclipse Java merger.
String getFileName()
Get the file name (without any path).
String getFormattedContent()
This method returns the entire contents of the generated file.
String getTargetPackage()
Get the target package for the file.
boolean isMergeable()
A Java file is mergeable if the getCompilationUnit() method returns a valid compilation unit.
[Expand]
Inherited Methods
From class org.mybatis.generator.api.GeneratedFile
From class java.lang.Object

Public Constructors

public GeneratedJavaFile (CompilationUnit compilationUnit, String targetProject)

Default constructor

Public Methods

public CompilationUnit getCompilationUnit ()

This method is required by the Eclipse Java merger. If you are not running in Eclipse, or some other system that implements the Java merge function, you may return null from this method.

Returns
  • the CompilationUnit associated with this file, or null if the file is not mergeable.

public 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.

public String getFormattedContent ()

This method 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.

public 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.

public boolean isMergeable ()

A Java file is mergeable if the getCompilationUnit() method returns a valid compilation unit.