Search in sources :

Example 1 with InvalidExistingFileException

use of org.mybatis.generator.eclipse.core.merge.InvalidExistingFileException in project generator by mybatis.

the class EclipseShellCallback method mergeJavaFile.

public String mergeJavaFile(String newFileSource, File existingFile, String[] javadocTags, String fileEncoding) throws ShellException {
    String existingFileContent = getExistingFileContents(existingFile, fileEncoding);
    JavaFileMerger merger = new JavaFileMerger(newFileSource, existingFileContent, javadocTags);
    try {
        return merger.getMergedSource();
    } catch (InvalidExistingFileException e) {
        throw translateInvalidExistingFileException(e, existingFile);
    }
}
Also used : InvalidExistingFileException(org.mybatis.generator.eclipse.core.merge.InvalidExistingFileException) JavaFileMerger(org.mybatis.generator.eclipse.core.merge.JavaFileMerger)

Aggregations

InvalidExistingFileException (org.mybatis.generator.eclipse.core.merge.InvalidExistingFileException)1 JavaFileMerger (org.mybatis.generator.eclipse.core.merge.JavaFileMerger)1