コード例 #1
0
  /**
   * Return the JSNI signature for a member. Leave off the return type for a method signature, so as
   * to match what a user would type in as a JsniRef.
   */
  private static String getJsniSignature(HasEnclosingType member, boolean wildcardParams) {
    if (member instanceof JField) {
      return ((JField) member).getName();
    }
    JMethod method = (JMethod) member;

    if (wildcardParams) {
      return method.getName() + "(" + JsniRef.WILDCARD_PARAM_LIST + ")";
    } else {
      return JProgram.getJsniSig(method, false);
    }
  }
コード例 #2
0
  private static void addMember(
      LinkedHashMap<String, LinkedHashMap<String, HasEnclosingType>> matchesBySig,
      HasEnclosingType member,
      String refSig) {
    LinkedHashMap<String, HasEnclosingType> matchesByFullSig = matchesBySig.get(refSig);
    if (matchesByFullSig == null) {
      matchesByFullSig = new LinkedHashMap<String, HasEnclosingType>();
      matchesBySig.put(refSig, matchesByFullSig);
    }

    String fullSig;
    if (member instanceof JField) {
      fullSig = ((JField) member).getName();
    } else {
      fullSig = JProgram.getJsniSig((JMethod) member);
    }

    matchesByFullSig.put(fullSig, member);
  }