Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-debug-dev] IJavaVariable hierarchy API


Thinking more about this, defining an IJavaField to extend an IJavaVariable, would be incorrect.

The notion of a field is something that is "instance independent" - it is a declaration (not a variable). I think we would need to follow the JDI design - a field declaration can be retreived from a type, and a field value can be retrieved from an object, given a field declaration. Thus, we would need to define the following:

IJavaField - represents a class (static) or instance variable in a type.
        #getName()
        #getJavaType()

Addition to IJavaObject
        #getValue(IJavaField field) - returns the value of a field (instance or static variable)

Addition to IJavaClassType()
        #getValue(IJavaField field) - returns the value of a static field
        #getFields() - returns all instance and static fields defined by this type
        #getField(String name) - returns the field with the given name (in this type or a super type)

Currenty, IJavaObject and IJavaClassType implement #getField(name) to return a variable - but those methods would need to be replaced. Also, we may need to introduce the concept of an IJavaInterfaceType, to allow access to interface constant definitions.

At the end of the day, I am not sure that this gives you the functionallity that we require (it just gives more function :-)

Darin

Back to the top