本文整理汇总了Java中sun.tools.java.Identifier.isQualified方法的典型用法代码示例。如果您正苦于以下问题:Java Identifier.isQualified方法的具体用法?Java Identifier.isQualified怎么用?Java Identifier.isQualified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.tools.java.Identifier
的用法示例。
在下文中一共展示了Identifier.isQualified方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setNames
import sun.tools.java.Identifier; //导入方法依赖的package包/类
/**
* Set name and package. May only be called during initialization.
*/
protected void setNames(Identifier id, String[] idlModuleNames, String idlName) {
this.id = id;
name = Names.mangleClass(id).getName().toString();
packageName = null;
if (id.isQualified()) {
packageName = id.getQualifier().toString();
qualifiedName = packageName + NAME_SEPARATOR + name;
} else {
qualifiedName = name;
}
setIDLNames(idlModuleNames,idlName);
}
示例2: getClassOrInterfaceName
import sun.tools.java.Identifier; //导入方法依赖的package包/类
/**
* Convert a type name.
* <p>
* Section 28.3.2.5
* Section 28.3.2.7 (class or interface names only)
* Throws exception if fails 28.3.2.7.
*/
public static String getClassOrInterfaceName (Identifier id,
BatchEnvironment env) throws Exception {
// Get the type and package name...
String typeName = id.getName().toString();
String packageName = null;
if (id.isQualified()) {
packageName = id.getQualifier().toString();
}
// Check namesCache...
String result = (String) env.namesCache.get(typeName);
if (result == null) {
// 28.3.2.5 Inner classes...
result = replace(typeName,". ","__");
// 28.3.2.4 Illegal identifier characters...
result = convertToISOLatin1(result);
// 28.3.2.7 Case sensitive class or interface names...
NameContext context = NameContext.forName(packageName,false,env);
context.assertPut(result);
// Run it through the name checks...
result = getTypeOrModuleName(result);
// Add it to the namesCache...
env.namesCache.put(typeName,result);
}
return result;
}