本文整理汇总了Java中org.mybatis.generator.exception.ShellException类的典型用法代码示例。如果您正苦于以下问题:Java ShellException类的具体用法?Java ShellException怎么用?Java ShellException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShellException类属于org.mybatis.generator.exception包,在下文中一共展示了ShellException类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
/**
* Write.
*
* @param node
* the node
* @throws ShellException
* the shell exception
*/
protected void write(DocumentType node) throws ShellException {
printWriter.print("<!DOCTYPE "); //$NON-NLS-1$
printWriter.print(node.getName());
String publicId = node.getPublicId();
String systemId = node.getSystemId();
if (publicId != null) {
printWriter.print(" PUBLIC \""); //$NON-NLS-1$
printWriter.print(publicId);
printWriter.print("\" \""); //$NON-NLS-1$
printWriter.print(systemId);
printWriter.print('\"');
} else if (systemId != null) {
printWriter.print(" SYSTEM \""); //$NON-NLS-1$
printWriter.print(systemId);
printWriter.print('"');
}
String internalSubset = node.getInternalSubset();
if (internalSubset != null) {
printWriter.println(" ["); //$NON-NLS-1$
printWriter.print(internalSubset);
printWriter.print(']');
}
printWriter.println('>');
}
示例2: write
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
protected void write(DocumentType node) throws ShellException {
printWriter.print("<!DOCTYPE "); //$NON-NLS-1$
printWriter.print(node.getName());
String publicId = node.getPublicId();
String systemId = node.getSystemId();
if (publicId != null) {
printWriter.print(" PUBLIC \""); //$NON-NLS-1$
printWriter.print(publicId);
printWriter.print("\" \""); //$NON-NLS-1$
printWriter.print(systemId);
printWriter.print('\"');
} else if (systemId != null) {
printWriter.print(" SYSTEM \""); //$NON-NLS-1$
printWriter.print(systemId);
printWriter.print('"');
}
String internalSubset = node.getInternalSubset();
if (internalSubset != null) {
printWriter.println(" ["); //$NON-NLS-1$
printWriter.print(internalSubset);
printWriter.print(']');
}
printWriter.println('>');
}
示例3: getDirectory
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
protected File getDirectory(String targetProject, String targetPackage) throws ShellException {
File project = new File(targetProject);
if (!project.isDirectory()) {
project.mkdir();
}
StringBuilder sb = new StringBuilder();
StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
while (st.hasMoreTokens()) {
sb.append(st.nextToken());
sb.append(File.separatorChar);
}
File directory = new File(project, sb.toString());
if (!directory.isDirectory()) {
boolean rc = directory.mkdirs();
if (!rc) {
throw new ShellException("创建失败" + project);
}
}
return directory;
}
示例4: write
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
protected void write(DocumentType node) throws ShellException {
printWriter.print("<!DOCTYPE "); //$NON-NLS-1$
printWriter.print(node.getName());
String publicId = node.getPublicId();
String systemId = node.getSystemId();
if (publicId != null) {
printWriter.print(" PUBLIC \""); //$NON-NLS-1$
printWriter.print(publicId);
printWriter.print("\" \""); //$NON-NLS-1$
printWriter.print(systemId);
printWriter.print('\"');
} else if (systemId != null) {
printWriter.print(" SYSTEM \""); //$NON-NLS-1$
printWriter.print(systemId);
printWriter.print('"');
}
String internalSubset = node.getInternalSubset();
if (internalSubset != null) {
printWriter.println(" ["); //$NON-NLS-1$
printWriter.print(internalSubset);
printWriter.print(']');
}
printWriter.println('>');
}
示例5: getDirectory
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
public File getDirectory(String targetProject, String targetPackage)
throws ShellException {
// targetProject is interpreted as a directory that must exist
//
// targetPackage is interpreted as a sub directory, but in package
// format (with dots instead of slashes). The sub directory will be
// created
// if it does not already exist
File project = new File(targetProject);
if (!project.isDirectory()) {
throw new ShellException(getString("Warning.9", //$NON-NLS-1$
targetProject));
}
StringBuilder sb = new StringBuilder();
StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
while (st.hasMoreTokens()) {
sb.append(st.nextToken());
sb.append(File.separatorChar);
}
File directory = new File(project, sb.toString());
if (!directory.isDirectory()) {
boolean rc = directory.mkdirs();
if (!rc) {
throw new ShellException(getString("Warning.10", //$NON-NLS-1$
directory.getAbsolutePath()));
}
}
return directory;
}
示例6: getDirectory
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
public File getDirectory(String targetProject, String targetPackage) throws ShellException {
// targetProject is interpreted as a directory that must exist
//
// targetPackage is interpreted as a sub directory, but in package
// format (with dots instead of slashes). The sub directory will be
// created
// if it does not already exist
File project = new File(targetProject);
if (!project.isDirectory()) {
throw new ShellException(getString("Warning.9", targetProject));
}
StringBuilder sb = new StringBuilder();
StringTokenizer st = new StringTokenizer(targetPackage, ".");
while (st.hasMoreTokens()) {
sb.append(st.nextToken());
sb.append(File.separatorChar);
}
File directory = new File(project, sb.toString());
if (!directory.isDirectory()) {
boolean rc = directory.mkdirs();
if (!rc) {
throw new ShellException(getString("Warning.10", directory.getAbsolutePath()));
}
}
return directory;
}
示例7: getDirectory
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
@Override
public File getDirectory(String targetProject, String targetPackage)
throws ShellException {
// targetProject is interpreted as a directory that must exist
//
// targetPackage is interpreted as a sub directory, but in package
// format (with dots instead of slashes). The sub directory will be
// created
// if it does not already exist
File project = new File(targetProject);
if (!project.isDirectory()) {
throw new ShellException(getString("Warning.9", //$NON-NLS-1$
targetProject));
}
StringBuilder sb = new StringBuilder();
StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
while (st.hasMoreTokens()) {
sb.append(st.nextToken());
sb.append(File.separatorChar);
}
File directory = new File(project, sb.toString());
if (!directory.isDirectory()) {
boolean rc = directory.mkdirs();
if (!rc) {
throw new ShellException(getString("Warning.10", //$NON-NLS-1$
directory.getAbsolutePath()));
}
}
return directory;
}
示例8: toString
import org.mybatis.generator.exception.ShellException; //导入依赖的package包/类
public synchronized String toString(Document document)
throws ShellException {
StringWriter sw = new StringWriter();
printWriter = new PrintWriter(sw);
write(document);
String s = sw.toString();
return s;
}