Package org.mybatis.generator.maven
Class MavenShellCallback
java.lang.Object
org.mybatis.generator.internal.DefaultShellCallback
org.mybatis.generator.maven.MavenShellCallback
- All Implemented Interfaces:
ShellCallback
Shell callback that calculates the Maven output directory.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMavenShellCallback(MyBatisGeneratorMojo mybatisGeneratorMojo, boolean overwrite) -
Method Summary
Modifier and TypeMethodDescriptiongetDirectory(String targetProject, String targetPackage) This method is called to ask the shell to resolve a project/package combination into a directory on the file system.Methods inherited from class org.mybatis.generator.internal.DefaultShellCallback
isOverwriteEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mybatis.generator.api.ShellCallback
isMergeSupported, mergeJavaFile, refreshProject
-
Field Details
-
mybatisGeneratorMojo
-
-
Constructor Details
-
MavenShellCallback
-
-
Method Details
-
getDirectory
Description copied from interface:ShellCallbackThis method is called to ask the shell to resolve a project/package combination into a directory on the file system. This method is called repeatedly (once for each generated file), so it would be wise for an implementing class to cache results.The returned
java.io.Fileobject:- Must be a directory
- Must exist
The default shell callback interprets both values as directories and simply concatenates the two values to generate the default directory.
- Specified by:
getDirectoryin interfaceShellCallback- Overrides:
getDirectoryin classDefaultShellCallback- Parameters:
targetProject- the target projecttargetPackage- the target package- Returns:
- the directory (must exist)
- Throws:
ShellException- if the project/package cannot be resolved into a directory on the file system. In this case, the generator will not save the file it is currently working on. The generator will add the exception message to the list of warnings automatically.
-