Package org.mybatis.generator.api
Class GeneratedJavaFile
java.lang.Object
org.mybatis.generator.api.GeneratedFile
org.mybatis.generator.api.GeneratedJavaFile
-
Field Summary
Fields inherited from class org.mybatis.generator.api.GeneratedFile
targetProject
-
Constructor Summary
ConstructorDescriptionGeneratedJavaFile
(CompilationUnit compilationUnit, String targetProject, String fileEncoding, JavaFormatter javaFormatter) GeneratedJavaFile
(CompilationUnit compilationUnit, String targetProject, JavaFormatter javaFormatter) -
Method Summary
Modifier and TypeMethodDescriptionThis method is required by the Eclipse Java merger.Get the file name (without any path).Returns the entire contents of the generated file.Get the target package for the file.boolean
A Java file is mergeable if the getCompilationUnit() method returns a valid compilation unit.Methods inherited from class org.mybatis.generator.api.GeneratedFile
getTargetProject, toString
-
Constructor Details
-
GeneratedJavaFile
public GeneratedJavaFile(CompilationUnit compilationUnit, String targetProject, String fileEncoding, JavaFormatter javaFormatter) -
GeneratedJavaFile
public GeneratedJavaFile(CompilationUnit compilationUnit, String targetProject, JavaFormatter javaFormatter)
-
-
Method Details
-
getFormattedContent
Description copied from class:GeneratedFile
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.- Specified by:
getFormattedContent
in classGeneratedFile
- Returns:
- Returns the content.
-
getFileName
Description copied from class:GeneratedFile
Get the file name (without any path). Clients should use this method to determine how to save the results.- Specified by:
getFileName
in classGeneratedFile
- Returns:
- Returns the file name.
-
getTargetPackage
Description copied from class:GeneratedFile
Get the target package for the file. Clients should use this method to determine how to save the results.- Specified by:
getTargetPackage
in classGeneratedFile
- Returns:
- Returns the target project.
-
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.
-
isMergeable
public boolean isMergeable()A Java file is mergeable if the getCompilationUnit() method returns a valid compilation unit.- Specified by:
isMergeable
in classGeneratedFile
- Returns:
- true, if is mergeable
-
getFileEncoding
- Specified by:
getFileEncoding
in classGeneratedFile
-