开发者

Resolved field/information - what does it mean?

开发者 https://www.devze.com 2023-03-05 23:29 出处:网络
I\'m using the implementation of IField interface. I have a problem with understanding \'resolved field\' - what does it mean?

I'm using the implementation of IField interface. I have a problem with understanding 'resolved field' - what does it mean? There even exists a function isResolved(), which:

Returns whether this field represents a resolved field. If a field is resolved, its key contains resolved information.

What does it m开发者_开发百科ean? Is there any second meaning of the word resolved which I can't find nor in a dictionary nor online?


'Resolved' is related to bindings. To quote from the javadoc of org.eclipse.jdt.core.dom.IBinding

A binding represents a named entity in the Java language. The world of bindings provides an integrated picture of the structure of the program as seen from the compiler's point of view.

In simpler words, a 'binding' is how you would uniquely identify an named entity and the 'key' is that unique information. You can find a bit more information on bindings in this tutorial.

Bindings are expensive and hence they are not always 'resolved', for example while creating an AST via org.eclipse.jdt.core.dom.ASTParser you can call ASTParser#setResolveBindings(boolean) to specify if you require bindings or not. Hence the isResolved() function indicates if the binding information is available or not, if it is then the getKey() returns that unique key.


Resolved may mean 'has a resolved type' ie a field with a generic type gets resolved when runtime type is known

a hint in some jdt source code

ResolvedBinaryMethod : Handle representing a binary method that is resolved.
The uniqueKey contains the genericSignature of the resolved method. Use BindingKey to decode it.

It's talking about generic signature... seems 'resolved' has something to do with type of generics :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消