Java Code Examples for com.sun.tools.javac.code.Symbol#getSimpleName()
The following examples show how to use
com.sun.tools.javac.code.Symbol#getSimpleName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavacTrees.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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; }
Example 2
Source File: JavacTrees.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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; }
Example 3
Source File: JavacTrees.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
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; }
Example 4
Source File: JavacTrees.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
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; }
Example 5
Source File: JavacTrees.java From hottub with GNU General Public License v2.0 | 6 votes |
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; }
Example 6
Source File: JavacTrees.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 6 votes |
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; }
Example 7
Source File: JavacTrees.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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; }
Example 8
Source File: RichDiagnosticFormatter.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * 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)); }
Example 9
Source File: RichDiagnosticFormatter.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * 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)); }
Example 10
Source File: RichDiagnosticFormatter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * 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)); }
Example 11
Source File: RichDiagnosticFormatter.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * 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)); }
Example 12
Source File: JNIWriter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
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(); } } }
Example 13
Source File: RichDiagnosticFormatter.java From javaide with GNU General Public License v3.0 | 5 votes |
/** * 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)); }
Example 14
Source File: RichDiagnosticFormatter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * 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)); }
Example 15
Source File: RichDiagnosticFormatter.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * 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)); }
Example 16
Source File: JNIWriter.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
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(); } } }
Example 17
Source File: RichDiagnosticFormatter.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * 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)); }
Example 18
Source File: RichDiagnosticFormatter.java From java-n-IDE-for-Android with Apache License 2.0 | 5 votes |
/** * 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)); }
Example 19
Source File: RichDiagnosticFormatter.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * 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)); }
Example 20
Source File: RichDiagnosticFormatter.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * 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)); }