>From your description if looks like you are trying following:

interface SomeJsInteface {
  @JsProperty String getName();
}

class SomeObject implements SomeJsInterface {
  public String name;
  public String getName() { return name; }
}

Making name field 'public' here is not really a solution. We need to
implement overriding of JsProperty properly. You need to wait little bit
longer for that.

You may work around this by making SomeObject a JsType but compiler my
complain about name conflict; you need to give it a try.

On Sun, Aug 9, 2015 at 5:47 AM, Ümit Seren <[email protected]> wrote:

> One more issue that came up.
>
> I have a @JsType interface and @JsProperty fields and a class that
> implements it with public fields and getters/setters.
> This works fine in DevMode and when compiling with draftCompile = true
>
> However as soon as I do a normal production compile the fields get
> obfuscated and renamed.
> Is this a known issue ?
>
>
>
> On Wednesday, July 29, 2015 at 9:11:58 PM UTC+2, Goktug Gokdogan wrote:
>
>>
>>
>> On Tue, Jul 28, 2015 at 8:36 AM, Ümit Seren <[email protected]> wrote:
>>
>>> I started to play around with JSInterop and GWT 2.8.0-SNAPSHOT.
>>>
>>> Primarily I was following these documentation:
>>>
>>>
>>> https://docs.google.com/document/d/1tir74SB-ZWrs-gQ8w-lOEV3oMY6u6lF2MmNivDEihZ4/edit#
>>>
>>> However I ran into some issues regarding properties that don’t follow
>>> Java bean style convention (i.e. xAxisParser) .
>>>
>>> According to the javaDocs on the @JsProperty annotation it should be
>>> possible to define properties also in this way : @JsProperty x(intx)
>>> which translates to this.x=y.
>>>
>>
>> The javadoc is not accurate, only bean convetions is supported at the
>> moment.
>>
>>
>>> However when I try this, the compiler complains that the property
>>> doesn’t follow Java Bean naming conventions.
>>>
>>> I found a recent post about overhaul of JsInterop’s annotations (
>>> https://groups.google.com/forum/#!searchin/google-web-toolkit-contributors/annotations/google-web-toolkit-contributors/Dwdk-aEHs8Y/OvSNe6egUekJ)
>>> and that it should be possible to
>>> override the property name.
>>>
>>> I was curious if this is planned for the 2.8.0 release or if this will
>>> go into GWT 3.0 ?
>>>
>>
>> It is planned for 2.8 release.
>>
>>
>>> Currently my only workaround is to use JSNI: to set the property
>>> directly:
>>>
>>> @JsType
>>> interface MyInterface {
>>>    @JsProperty void setTitle(String title);
>>>    @JsProperty String getTitle();
>>>
>>>    void setXAxisParser(Callback callback);
>>> }
>>>
>>> public MyClass implements MyInterface {
>>>      public String title;
>>>      public Callback callback;
>>>
>>>     @Override
>>>      public void setTitle(String title) {
>>>          this.title = title;
>>>      }
>>>      @Override
>>>      public String getTitle() {
>>>           return title;
>>>      }
>>>      @Override
>>>      public void setXAxisParser(Callback callback)/*-{
>>>          this.xValueParser = callback;
>>>      }*-/;
>>> }
>>>
>>> ​
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "GWT Contributors" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected]
>>> .
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/64db778c-7fca-45b7-a0c8-52aae0c6968f%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/64db778c-7fca-45b7-a0c8-52aae0c6968f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/89f59140-ed1b-4461-9386-2cf0a1861d99%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/89f59140-ed1b-4461-9386-2cf0a1861d99%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA1ex-YjPbbGhB93js-nRCiwDTJySOZ%2Bb0vDXB%3DAO1Pe%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to