Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » From String signature to o.e.j.internal.compiler.lookup.TypeBinding?(internals)
From String signature to o.e.j.internal.compiler.lookup.TypeBinding? [message #1220250] Tue, 10 December 2013 10:54 Go to next message
Eclipse UserFriend
Hi JDT committers,

from the InternalCompletionContext I fetch the expected type signature using getExpectedTypesSignatures().

To make efficient subtype tests, I need to convert these strings back to TypeBindings. This works nicely with LookupEnvironment.getType(splittedTypeSignature) but only for signatures that do not contain generics.


However, when I have a String like the one below, this fails. What is the most generic way to convert a String like "Ljava.util.List<Ljava.lang.String;>;" to a TypeBinding (given that I've access to the LookupEnvironment)?


Thanks for your hints,
Marcel
Re: From String signature to o.e.j.internal.compiler.lookup.TypeBinding? [message #1220261 is a reply to message #1220250] Tue, 10 December 2013 12:39 Go to previous messageGo to next message
Eclipse UserFriend
If you "invent" a few of the required argument values, you might be able to use
getTypeFromTypeSignature(SignatureWrapper,TypeVariableBinding[],ReferenceBinding,char[][][],TypeAnnotationWalker)


I guess that for your case most arguments can actually be null, but please verify.

Of course, class SignatureWrapper is internal, too, ...

HTH,
Stephan
Re: From String signature to o.e.j.internal.compiler.lookup.TypeBinding? [message #1220330 is a reply to message #1220261] Wed, 11 December 2013 02:00 Go to previous message
Eclipse UserFriend
Looked at this method before but had no instance for enclosingType at hand. It returned an unresolved binding java.util.List in that case. Will try to find an instance of enclosing type and check again. Thanks for the pointer!

[Updated on: Wed, 11 December 2013 02:02] by Moderator

Previous Topic:Integrate a barcode generator in my java program
Next Topic:Conditionally enable/disable custom builders
Goto Forum:
  


Current Time: Thu Apr 24 10:56:03 EDT 2025

Powered by FUDForum. Page generated in 0.03591 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top