Example #1
0
 protected void createResourceURIForTypeVariable(
     ITypeBinding typeBinding, StringBuilder uriBuilder) {
   if (typeBinding.getDeclaringClass() != null) {
     ITypeBinding declaringClass = typeBinding.getDeclaringClass();
     createResourceURIForClass(declaringClass, uriBuilder);
   } else {
     IMethodBinding declaringMethod = typeBinding.getDeclaringMethod();
     ITypeBinding declaringClass = declaringMethod.getDeclaringClass();
     createResourceURIForClass(declaringClass, uriBuilder);
   }
 }
Example #2
0
 protected void createResourceURIForClass(ITypeBinding typeBinding, StringBuilder uriBuilder) {
   ITypeBinding declaringClass = typeBinding.getDeclaringClass();
   if (declaringClass != null) {
     createResourceURIForClass(declaringClass, uriBuilder);
   } else {
     createResourceURIForClassImpl2(typeBinding.getErasure().getQualifiedName(), uriBuilder);
   }
 }
Example #3
0
 protected void createResourceURI(String signature, StringBuilder uriBuilder) {
   try {
     int signatureKind = Signature.getTypeSignatureKind(signature);
     switch (signatureKind) {
       case Signature.BASE_TYPE_SIGNATURE:
         createResourceURIForPrimitive(uriBuilder);
         return;
       case Signature.CLASS_TYPE_SIGNATURE:
         createResourceURIForClass(signature, uriBuilder);
         return;
       case Signature.ARRAY_TYPE_SIGNATURE:
         createResourceURIForArray(signature, uriBuilder);
         return;
       default:
         throw new IllegalStateException("Unexpected Signature: " + signature);
     }
   } catch (IllegalArgumentException e) {
     throw new IllegalArgumentException(e.getMessage() + " was: " + signature, e);
   }
 }
Example #4
0
 protected void createResourceURI(ITypeBinding typeBinding, StringBuilder uriBuilder) {
   if (typeBinding.isPrimitive()) {
     createResourceURIForPrimitive(uriBuilder);
     return;
   }
   if (typeBinding.isClass()
       || typeBinding.isInterface()
       || typeBinding.isAnnotation()
       || typeBinding.isEnum()) {
     createResourceURIForClass(typeBinding, uriBuilder);
     return;
   }
   if (typeBinding.isArray()) {
     createResourceURIForArray(typeBinding, uriBuilder);
     return;
   }
   if (typeBinding.isTypeVariable()) {
     createResourceURIForTypeVariable(typeBinding, uriBuilder);
     return;
   }
   throw new IllegalStateException("Unexpected type: " + typeBinding);
 }