protected String getRawTypeIdentifier(JvmTypeReference reference) {
   if (reference instanceof JvmParameterizedTypeReference) {
     JvmType typeOrProxy =
         (JvmType)
             reference.eGet(TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE, false);
     if (typeOrProxy.eIsProxy()) {
       URI uri = ((InternalEObject) typeOrProxy).eProxyURI();
       if (URIHelperConstants.PROTOCOL.equals(uri.scheme())) {
         if (URIHelperConstants.PRIMITIVES.regionMatches(
             1, uri.segment(0), 0, URIHelperConstants.PRIMITIVES.length() - 1)) {
           String fragment = uri.fragment();
           return fragment;
         } else if (URIHelperConstants.OBJECTS.regionMatches(
             1, uri.segment(0), 0, URIHelperConstants.OBJECTS.length() - 2)) {
           String fragment = uri.fragment();
           if (fragment.lastIndexOf('/') == -1) return fragment;
         }
       }
     }
   }
   RawTypeReferenceComputer strategy = new RawTypeReferenceComputer(TypesFactory.eINSTANCE);
   JvmTypeReference result = strategy.getRawTypeReference(reference, eResource());
   if (result == null) return null;
   JvmType rawResult = result.getType();
   return rawResult == null ? null : rawResult.getIdentifier();
 }
Esempio n. 2
0
 public URI createResourceURIFromString(String withoutProtocol) {
   StringBuilder uriBuilder =
       new StringBuilder(URIHelperConstants.PROTOCOL.length() + 1 + withoutProtocol.length());
   uriBuilder.append(URIHelperConstants.PROTOCOL).append(":").append(withoutProtocol);
   return createURI(uriBuilder);
 }