public class DefaultShellCallback extends Object implements ShellCallback
Constructor and Description |
---|
DefaultShellCallback(boolean overwrite) |
Modifier and Type | Method and Description |
---|---|
File |
getDirectory(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.
|
boolean |
isOverwriteEnabled()
Return true if the generator should overwrite an existing file if one exists.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isMergeSupported, mergeJavaFile, refreshProject
public File getDirectory(String targetProject, String targetPackage) throws ShellException
ShellCallback
The returned java.io.File
object:
The default shell callback interprets both values as directories and simply concatenates the two values to generate the default directory.
getDirectory
in interface ShellCallback
targetProject
- the target projecttargetPackage
- the target packageShellException
- 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.public boolean isOverwriteEnabled()
ShellCallback
isMergeSupported()
returns false
and a file exists that would be overwritten by
a generated file. If you return true
, then we will log a
warning specifying what file was overwritten.isOverwriteEnabled
in interface ShellCallback
Copyright © 2006–2023 MyBatis.org. All rights reserved.