On 01/11/2012 11:31 AM, Peter Johnsen wrote:
> Hi,
>
> I have an EObject of an EClass with an integer attribute named 'a'. Is
> is possible to
> read the value for this attribute from the EObject, intuitively like
> this (pseudo code):
>
> EObject o ... ;
> EAttribute a = o.eClass.getAttribute( "a" );
> int aValue = o.getValue( a );
>
> I've searched the API, but couldn't find how to do this.

You need the EStructuralFeature, but as you showed in your own code, you
already know how to get that from the EObject's eClass().

On 01/11/2012 12:00 PM, Peter Johnsen wrote:
> Thanks for your prompt reply!
>
> OK, but if I don't have the EAttribute object? That is, I only have
> the name of the attribute? Are there any EMF-ways to do this, or would
> I have to use reflection?