コード例 #1
0
 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();
 }
コード例 #2
0
 protected JvmType getRawType(JvmTypeReference reference) {
   RawTypeReferenceComputer strategy = new RawTypeReferenceComputer(TypesFactory.eINSTANCE);
   JvmTypeReference result = strategy.getRawTypeReference(reference, eResource());
   return result == null ? null : result.getType();
 }