Ejemplo n.º 1
0
 /**
  * Returns the fully qualified type name associated with the given member.
  *
  * @param member
  * @return fully qualified type name
  */
 protected String getTypeName(IApiMember member) throws CoreException {
   switch (member.getType()) {
     case IApiElement.TYPE:
       {
         IApiType type = (IApiType) member;
         if (type.isAnonymous()) {
           return getTypeName(member.getEnclosingType());
         } else if (type.isLocal()) {
           return getTypeName(member.getEnclosingType());
         }
         return member.getName();
       }
     default:
       {
         return getTypeName(member.getEnclosingType());
       }
   }
 }
Ejemplo n.º 2
0
 /**
  * Returns the unqualified type name associated with the given member.
  *
  * @param member
  * @return unqualified type name
  */
 protected String getSimpleTypeName(IApiMember member) throws CoreException {
   switch (member.getType()) {
     case IApiElement.TYPE:
       {
         IApiType type = (IApiType) member;
         if (type.isAnonymous()) {
           return getSimpleTypeName(type.getEnclosingType());
         } else if (type.isLocal()) {
           String name = getSimpleTypeName(member.getEnclosingType());
           int idx = name.indexOf('$');
           if (idx > -1) {
             return name.substring(0, idx);
           }
           return name;
         }
         return Signatures.getTypeName(Signatures.getTypeSignature(type));
       }
     default:
       return getSimpleTypeName(member.getEnclosingType());
   }
 }