本文整理汇总了Java中com.sun.tools.javac.code.Symbol.getSimpleName方法的典型用法代码示例。如果您正苦于以下问题:Java Symbol.getSimpleName方法的具体用法?Java Symbol.getSimpleName怎么用?Java Symbol.getSimpleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.code.Symbol
的用法示例。
在下文中一共展示了Symbol.getSimpleName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attributeParamIdentifier
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
private Symbol attributeParamIdentifier(TreePath path, DCParam ptag) {
Symbol javadocSymbol = getElement(path);
if (javadocSymbol == null)
return null;
ElementKind kind = javadocSymbol.getKind();
List<? extends Symbol> params = List.nil();
if (kind == ElementKind.METHOD || kind == ElementKind.CONSTRUCTOR) {
MethodSymbol ee = (MethodSymbol) javadocSymbol;
params = ptag.isTypeParameter()
? ee.getTypeParameters()
: ee.getParameters();
} else if (kind.isClass() || kind.isInterface()) {
ClassSymbol te = (ClassSymbol) javadocSymbol;
params = te.getTypeParameters();
}
for (Symbol param : params) {
if (param.getSimpleName() == ptag.getName().getName()) {
return param;
}
}
return null;
}
示例2: addUsage
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
/**
* Add a name usage to the simplifier's internal cache
*/
protected void addUsage(Symbol sym) {
Name n = sym.getSimpleName();
List<Symbol> conflicts = nameClashes.get(n);
if (conflicts == null) {
conflicts = List.nil();
}
if (!conflicts.contains(sym))
nameClashes.put(n, conflicts.append(sym));
}
示例3: writeMethods
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
protected void writeMethods(PrintWriter out, ClassSymbol sym, String cname)
throws IOException, TypeSignature.SignatureException {
List<Symbol> classmethods = sym.getEnclosedElements();
for (Symbol md : classmethods) {
if (isNative(md)) {
TypeSignature newtypesig = new TypeSignature(types);
CharSequence methodName = md.getSimpleName();
boolean isOverloaded = false;
for (Symbol md2 : classmethods) {
if ((md2 != md)
&& (methodName.equals(md2.getSimpleName()))
&& isNative(md2)) {
isOverloaded = true;
}
}
out.println("/*");
out.println(" * Class: " + cname);
out.println(" * Method: " + encode(methodName, EncoderType.FIELDSTUB));
out.println(" * Signature: " + newtypesig.getSignature(md.type));
out.println(" */");
out.println("JNIEXPORT " + jniType(types.erasure(md.type.getReturnType()))
+ " JNICALL " + encodeMethod(md, sym, isOverloaded));
out.print(" (JNIEnv *, ");
out.print((md.isStatic())
? "jclass"
: "jobject");
for (Type arg : types.erasure(md.type.getParameterTypes())) {
out.print(", ");
out.print(jniType(arg));
}
out.println(");");
out.println();
}
}
}