本文整理汇总了Java中com.sun.tools.internal.ws.processor.generator.GeneratorException类的典型用法代码示例。如果您正苦于以下问题:Java GeneratorException类的具体用法?Java GeneratorException怎么用?Java GeneratorException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeneratorException类属于com.sun.tools.internal.ws.processor.generator包,在下文中一共展示了GeneratorException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ensureDirectory
import com.sun.tools.internal.ws.processor.generator.GeneratorException; //导入依赖的package包/类
private static void ensureDirectory(File dir) throws GeneratorException {
if (!dir.exists()) {
boolean created = dir.mkdirs();
if (!created || !dir.exists()) {
throw new GeneratorException("generator.cannot.create.dir",
dir.getAbsolutePath());
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:DirectoryUtil.java
示例2: p
import com.sun.tools.internal.ws.processor.generator.GeneratorException; //导入依赖的package包/类
public void p(String s) throws IOException {
/*
int tabCount = 0;
for (int i = 0; i < s.length(); ++i) {
if (s.charAt(i) == '\t') {
++tabCount;
indentIn();
}
}
String printStr = s.substring(tabCount);
*/
boolean canEncode = true;
//bug fix: 4839636
try{
if(!canEncode(s)) {
canEncode = false;
}
} catch (Throwable t) {
// there was some exception, what should we do?
// lets ignore it for now and proceed with the code generation!
}
if(!canEncode) {
throw new GeneratorException(
"generator.indentingwriter.charset.cantencode", s);
}
write(s);
/*
while (tabCount-- > 0) {
indentOut();
}
*/
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:IndentingWriter.java
示例3: ensureDirectory
import com.sun.tools.internal.ws.processor.generator.GeneratorException; //导入依赖的package包/类
private static void ensureDirectory(File dir)
throws GeneratorException {
if (!dir.exists()) {
dir.mkdirs();
if (!dir.exists()) {
throw new GeneratorException("generator.cannot.create.dir",
dir.getAbsolutePath());
}
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:12,代码来源:DirectoryUtil.java
示例4: getOutputDirectoryFor
import com.sun.tools.internal.ws.processor.generator.GeneratorException; //导入依赖的package包/类
public static File getOutputDirectoryFor(String theClass, File rootDir) throws GeneratorException {
File outputDir = null;
String qualifiedClassName = theClass;
String packagePath = null;
String packageName = ClassNameInfo.getQualifier(qualifiedClassName);
if (packageName != null && packageName.length() > 0) {
packagePath = packageName.replace('.', File.separatorChar);
}
// Do we have a root directory?
if (rootDir != null) {
// Yes, do we have a package name?
if (packagePath != null) {
// Yes, so use it as the root. Open the directory...
outputDir = new File(rootDir, packagePath);
// Make sure the directory exists...
ensureDirectory(outputDir);
} else {
// Default package, so use root as output dir...
outputDir = rootDir;
}
} else {
// No root directory. Get the current working directory...
String workingDirPath = System.getProperty("user.dir");
File workingDir = new File(workingDirPath);
// Do we have a package name?
if (packagePath == null) {
// No, so use working directory...
outputDir = workingDir;
} else {
// Yes, so use working directory as the root...
outputDir = new File(workingDir, packagePath);
// Make sure the directory exists...
ensureDirectory(outputDir);
}
}
// Finally, return the directory...
return outputDir;
}
开发者ID:campolake,项目名称:openjdk9,代码行数:51,代码来源:DirectoryUtil.java
注:本文中的com.sun.tools.internal.ws.processor.generator.GeneratorException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论