本文整理汇总了Java中sun.tools.java.Identifier.lookup方法的典型用法代码示例。如果您正苦于以下问题:Java Identifier.lookup方法的具体用法?Java Identifier.lookup怎么用?Java Identifier.lookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.tools.java.Identifier
的用法示例。
在下文中一共展示了Identifier.lookup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mangleClass
import sun.tools.java.Identifier; //导入方法依赖的package包/类
/**
* If necessary, convert a class name to its mangled form, i.e. the
* non-inner class name used in the binary representation of
* inner classes. This is necessary to be able to name inner
* classes in the generated source code in places where the language
* does not permit it, such as when synthetically defining an inner
* class outside of its outer class, and for generating file names
* corresponding to inner classes.
*
* Currently this mangling involves modifying the internal names of
* inner classes by converting occurrences of ". " into "$".
*
* This code is taken from the "mangleInnerType" method of
* the "sun.tools.java.Type" class; this method cannot be accessed
* itself because it is package protected.
*/
static final public Identifier mangleClass(Identifier className) {
if (!className.isInner())
return className;
/*
* Get '.' qualified inner class name (with outer class
* qualification and no package qualification) and replace
* each '.' with '$'.
*/
Identifier mangled = Identifier.lookup(
className.getFlatName().toString()
.replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
if (mangled.isInner())
throw new Error("failed to mangle inner class name");
// prepend package qualifier back for returned identifier
return Identifier.lookup(className.getQualifier(), mangled);
}
示例2: stubFor
import sun.tools.java.Identifier; //导入方法依赖的package包/类
/**
* Return stub class name for impl class name.
*/
static final public Identifier stubFor(Identifier name) {
return Identifier.lookup(name + "_Stub");
}
示例3: skeletonFor
import sun.tools.java.Identifier; //导入方法依赖的package包/类
/**
* Return skeleton class name for impl class name.
*/
static final public Identifier skeletonFor(Identifier name) {
return Identifier.lookup(name + "_Skel");
}