コード例 #1
0
 /**
  * Adds all visible methods to the given set in the specified type.
  *
  * @param type type to analyze
  * @param members set to add methods to
  * @param modifiers visibilities to consider
  */
 private void gatherVisibleMethods(IApiType type, Set<MethodKey> members, int modifiers) {
   IApiMethod[] methods = type.getMethods();
   for (int i = 0; i < methods.length; i++) {
     IApiMethod method = methods[i];
     if ((method.getModifiers() & modifiers) > 0
         && !method.isConstructor()
         && !method.isSynthetic()) {
       members.add(new MethodKey(type.getName(), method.getName(), method.getSignature(), false));
     }
   }
 }
コード例 #2
0
 /**
  * Returns whether the referenced type name matches a non-API package.
  *
  * @param reference
  * @return whether the referenced type name matches a non-API package
  */
 protected boolean isNonAPIReference(IReference reference) {
   String packageName = Signatures.getPackageName(reference.getReferencedTypeName());
   if (fNonApiPackageNames.contains(packageName)) {
     return true;
   }
   // could be a reference to a package visible type
   IApiMember member = reference.getMember();
   IApiType type = null;
   if (member.getType() == IApiElement.TYPE) {
     type = (IApiType) member;
   } else {
     type = (IApiType) member.getAncestor(IApiElement.TYPE);
   }
   String origin = Signatures.getPackageName(type.getName());
   if (packageName.equals(origin)) {
     return true; // possible package visible reference
   }
   return false;
 }