|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ibatis.ibator.internal.DefaultShellCallback
public class DefaultShellCallback
Constructor Summary | |
---|---|
DefaultShellCallback(boolean overwrite)
|
Method Summary | |
---|---|
java.io.File |
getDirectory(java.lang.String targetProject,
java.lang.String targetPackage)
ibator will call this method to ask the shell to resolve a project/package combination into a directory on the file system. |
boolean |
isMergeSupported()
Return true if the callback supports Java merging, otherwise false. |
boolean |
isOverwriteEnabled()
Return true if ibator should overwrite an existing file if one exists. |
java.lang.String |
mergeJavaFile(java.lang.String newFileSource,
java.lang.String existingFileFullPath,
java.lang.String[] javadocTags)
ibator will call this method if a newly generated Java file would overwrite an existing file. |
void |
refreshProject(java.lang.String project)
After all files are saved to the file system, ibator will call this method once for each unique project that was affected by the generation run. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultShellCallback(boolean overwrite)
Method Detail |
---|
public java.io.File getDirectory(java.lang.String targetProject, java.lang.String targetPackage) throws ShellException
ShellCallback
java.io.File
object:
getDirectory
in interface ShellCallback
ShellException
- if the project/package cannot be resolved into
a directory on the file system. In this case, ibator will not save the
file it is currently working on. ibator
will add the exception message to the list of warnings automatically.public void refreshProject(java.lang.String project)
ShellCallback
refreshProject
in interface ShellCallback
project
- the project to be refreshedpublic boolean isMergeSupported()
ShellCallback
mergeJavaFile()
method if this
method returns true
.
isMergeSupported
in interface ShellCallback
public boolean isOverwriteEnabled()
ShellCallback
isMergeSupported()
returns false
and a file exists that would be overwritten by a generated
file. If you return true
, then ibator will log
a warning specifying what file was overwritten.
isOverwriteEnabled
in interface ShellCallback
public java.lang.String mergeJavaFile(java.lang.String newFileSource, java.lang.String existingFileFullPath, java.lang.String[] javadocTags) throws ShellException
ShellCallback
true
from isMergeSupported()
.
mergeJavaFile
in interface ShellCallback
newFileSource
- the source of the newly generated Java fileexistingFileFullPath
- the fully qualified path name of the existing Java filejavadocTags
- the JavaDoc tags that denotes which methods and fields in the
old file to delete (if the Java element has any of these tags, the
element is eligible for merge)
ShellException
- if the file cannot be merged for some reason. If this
exception is thrown, ibator will not save anything and
the existing file will remain undisturbed. ibator
will add the exception message to the list of warnings automatically.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |