DWR and Enum

View: New views
10 Messages — Rating Filter:   Alert me  

DWR and Enum

by Andrew Dashin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys.

I have class

*public class* Event {

  *public enum* EventType {TYPE1, TYPE2};

  *private *EventType type;

 * public *EventType getEventType() {
     *return this*.type;
  }

}

I've defined this class as converter, and during work it fails with:
No converter found for Event.EventType.
So client recieves Event objects with type == null.

Could you please advise me anything?

--
Andrew Dashin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: DWR and Enum

by Lance Semmens-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

dwr.xml

<allow>
    <convert converter="enum" match="
mypackage.EventType"/>
</allow>

Cheers,
Lance.

Andrew Dashin wrote:
Hi guys.

I have class

*public class* Event {

 *public enum* EventType {TYPE1, TYPE2};

 *private *EventType type;

* public *EventType getEventType() {
    *return this*.type;
 }

}

I've defined this class as converter, and during work it fails with:
No converter found for Event.EventType.
So client recieves Event objects with type == null.

Could you please advise me anything?


Re: DWR and Enum

by Andrew Dashin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lance пишет:

> dwr.xml
>
> <allow>
>     <convert converter="enum" match="mypackage.EventType"/>
> </allow>
>
> Cheers,
> Lance.
>
> Andrew Dashin wrote:
>> Hi guys.
>>
>> I have class
>>
>> *public class* Event {
>>
>>  *public enum* EventType {TYPE1, TYPE2};
>>
>>  *private *EventType type;
>>
>> * public *EventType getEventType() {
>>     *return this*.type;
>>  }
>>
>> }
>>
>> I've defined this class as converter, and during work it fails with:
>> No converter found for Event.EventType.
>> So client recieves Event objects with type == null.
>>
>> Could you please advise me anything?
>>
This works only when EventType is in a separate file, but when it is an
inner class of Event - it doesn't work.
Even if I try
<allow>
    <convert converter="enum" match="Event.EventType"/>
</allow>

So I've made it as a separate class. But anyway it is interesting if
there is a way to make it work as an inner class.

--
Andrew Dashin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: DWR and Enum

by Lance Semmens-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In your example, EventType is not static. Therefore for EventType to exist, an Event must exist.
Try declaring your inner enum as static.

public class Event {
    public static enum EventType {TYPE1, TYPE2 };


Andrew Dashin wrote:
Lance пишет:
dwr.xml

<allow>
    <convert converter="enum" match="mypackage.EventType"/>
</allow>

Cheers,
Lance.

Andrew Dashin wrote:
Hi guys.

I have class

*public class* Event {

 *public enum* EventType {TYPE1, TYPE2};

 *private *EventType type;

* public *EventType getEventType() {
    *return this*.type;
 }

}

I've defined this class as converter, and during work it fails with:
No converter found for Event.EventType.
So client recieves Event objects with type == null.

Could you please advise me anything?

This works only when EventType is in a separate file, but when it is an inner class of Event - it doesn't work.
Even if I try
<allow>
   <convert converter="enum" match="Event.EventType"/>
</allow>

So I've made it as a separate class. But anyway it is interesting if there is a way to make it work as an inner class.


Re: DWR and Enum

by Andrew Dashin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lance пишет:

> In your example, EventType is not static. Therefore for EventType to
> exist, an Event must exist.
> Try declaring your inner enum as static.
>
> public class Event {
>     public *static* enum EventType {TYPE1, TYPE2 };
>
>
> Andrew Dashin wrote:
>> Lance пишет:
>>> dwr.xml
>>>
>>> <allow>
>>>     <convert converter="enum" match="mypackage.EventType"/>
>>> </allow>
>>>
>>> Cheers,
>>> Lance.
>>>
>>> Andrew Dashin wrote:
>>>> Hi guys.
>>>>
>>>> I have class
>>>>
>>>> *public class* Event {
>>>>
>>>>  *public enum* EventType {TYPE1, TYPE2};
>>>>
>>>>  *private *EventType type;
>>>>
>>>> * public *EventType getEventType() {
>>>>     *return this*.type;
>>>>  }
>>>>
>>>> }
>>>>
>>>> I've defined this class as converter, and during work it fails with:
>>>> No converter found for Event.EventType.
>>>> So client recieves Event objects with type == null.
>>>>
>>>> Could you please advise me anything?
>>>>
>> This works only when EventType is in a separate file, but when it is
>> an inner class of Event - it doesn't work.
>> Even if I try
>> <allow>
>>    <convert converter="enum" match="Event.EventType"/>
>> </allow>
>>
>> So I've made it as a separate class. But anyway it is interesting if
>> there is a way to make it work as an inner class.
>>
I've tried this a time ago - doesn't work.

--
Andrew Dashin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: DWR and Enum

by Lance Semmens-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, last try.
Enum must be static, use "$" instead of "."

<allow>
    <convert converter="enum" match="Event$EventType"/>
</allow>

Should work.

Andrew Dashin wrote:
Lance пишет:
In your example, EventType is not static. Therefore for EventType to exist, an Event must exist.
Try declaring your inner enum as static.

public class Event {
    public *static* enum EventType {TYPE1, TYPE2 };


Andrew Dashin wrote:
Lance пишет:
dwr.xml

<allow>
    <convert converter="enum" match="mypackage.EventType"/>
</allow>

Cheers,
Lance.

Andrew Dashin wrote:
Hi guys.

I have class

*public class* Event {

 *public enum* EventType {TYPE1, TYPE2};

 *private *EventType type;

* public *EventType getEventType() {
    *return this*.type;
 }

}

I've defined this class as converter, and during work it fails with:
No converter found for Event.EventType.
So client recieves Event objects with type == null.

Could you please advise me anything?

This works only when EventType is in a separate file, but when it is an inner class of Event - it doesn't work.
Even if I try
<allow>
   <convert converter="enum" match="Event.EventType"/>
</allow>

So I've made it as a separate class. But anyway it is interesting if there is a way to make it work as an inner class.

I've tried this a time ago - doesn't work.


Re: DWR and Enum

by nbourdeau :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is working but is it possible to use wildcards for including any inner class in a package ??

like this :

<convert converter="enum" match="mypackage.*$*"/>

or do we have to configure a convert for each inner class ??

Lance Semmens-3 wrote:
Ok, last try.
Enum must be static, use "$" instead of "."

<allow>
    <convert converter="enum" match="Event$EventType"/>
</allow>

Should work.

Andrew Dashin wrote:
> Lance пишет:
>> In your example, EventType is not static. Therefore for EventType to
>> exist, an Event must exist.
>> Try declaring your inner enum as static.
>>
>> public class Event {
>>     public *static* enum EventType {TYPE1, TYPE2 };
>>
>>
>> Andrew Dashin wrote:
>>> Lance пишет:
>>>> dwr.xml
>>>>
>>>> <allow>
>>>>     <convert converter="enum" match="mypackage.EventType"/>
>>>> </allow>
>>>>
>>>> Cheers,
>>>> Lance.
>>>>
>>>> Andrew Dashin wrote:
>>>>> Hi guys.
>>>>>
>>>>> I have class
>>>>>
>>>>> *public class* Event {
>>>>>
>>>>>  *public enum* EventType {TYPE1, TYPE2};
>>>>>
>>>>>  *private *EventType type;
>>>>>
>>>>> * public *EventType getEventType() {
>>>>>     *return this*.type;
>>>>>  }
>>>>>
>>>>> }
>>>>>
>>>>> I've defined this class as converter, and during work it fails with:
>>>>> No converter found for Event.EventType.
>>>>> So client recieves Event objects with type == null.
>>>>>
>>>>> Could you please advise me anything?
>>>>>
>>> This works only when EventType is in a separate file, but when it is
>>> an inner class of Event - it doesn't work.
>>> Even if I try
>>> <allow>
>>>    <convert converter="enum" match="Event.EventType"/>
>>> </allow>
>>>
>>> So I've made it as a separate class. But anyway it is interesting if
>>> there is a way to make it work as an inner class.
>>>
> I've tried this a time ago - doesn't work.
>

Re: DWR and Enum

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Usually ** matches all classes but I have not been following the conversation

Regards

On Wed, Oct 21, 2009 at 7:38 PM, nbourdeau <nbourdeau@...> wrote:

This is working but is it possible to use wildcards for including any inner
class in a package ??

like this :

<convert converter="enum" match="mypackage.*$*"/>

or do we have to configure a convert for each inner class ??


Lance Semmens-3 wrote:
>
> Ok, last try.
> Enum must be static, use "$" instead of "."
>
> <allow>
>     <convert converter="enum" match="Event$EventType"/>
> </allow>
>
> Should work.
>
> Andrew Dashin wrote:
>> Lance пишет:
>>> In your example, EventType is not static. Therefore for EventType to
>>> exist, an Event must exist.
>>> Try declaring your inner enum as static.
>>>
>>> public class Event {
>>>     public *static* enum EventType {TYPE1, TYPE2 };
>>>
>>>
>>> Andrew Dashin wrote:
>>>> Lance пишет:
>>>>> dwr.xml
>>>>>
>>>>> <allow>
>>>>>     <convert converter="enum" match="mypackage.EventType"/>
>>>>> </allow>
>>>>>
>>>>> Cheers,
>>>>> Lance.
>>>>>
>>>>> Andrew Dashin wrote:
>>>>>> Hi guys.
>>>>>>
>>>>>> I have class
>>>>>>
>>>>>> *public class* Event {
>>>>>>
>>>>>>  *public enum* EventType {TYPE1, TYPE2};
>>>>>>
>>>>>>  *private *EventType type;
>>>>>>
>>>>>> * public *EventType getEventType() {
>>>>>>     *return this*.type;
>>>>>>  }
>>>>>>
>>>>>> }
>>>>>>
>>>>>> I've defined this class as converter, and during work it fails with:
>>>>>> No converter found for Event.EventType.
>>>>>> So client recieves Event objects with type == null.
>>>>>>
>>>>>> Could you please advise me anything?
>>>>>>
>>>> This works only when EventType is in a separate file, but when it is
>>>> an inner class of Event - it doesn't work.
>>>> Even if I try
>>>> <allow>
>>>>    <convert converter="enum" match="Event.EventType"/>
>>>> </allow>
>>>>
>>>> So I've made it as a separate class. But anyway it is interesting if
>>>> there is a way to make it work as an inner class.
>>>>
>> I've tried this a time ago - doesn't work.
>>
>
>

--
View this message in context: http://www.nabble.com/DWR-and-Enum-tp11960744p25996923.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: DWR and Enum

by nbourdeau :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok thank you. I'll try this.

XMaNIaC wrote:
Usually ** matches all classes but I have not been following the
conversation
Regards

On Wed, Oct 21, 2009 at 7:38 PM, nbourdeau <nbourdeau@diffusion.cc> wrote:

>
> This is working but is it possible to use wildcards for including any inner
> class in a package ??
>
> like this :
>
> <convert converter="enum" match="mypackage.*$*"/>
>
> or do we have to configure a convert for each inner class ??
>
>
> Lance Semmens-3 wrote:
> >
> > Ok, last try.
> > Enum must be static, use "$" instead of "."
> >
> > <allow>
> >     <convert converter="enum" match="Event$EventType"/>
> > </allow>
> >
> > Should work.
> >
> > Andrew Dashin wrote:
> >> Lance пишет:
> >>> In your example, EventType is not static. Therefore for EventType to
> >>> exist, an Event must exist.
> >>> Try declaring your inner enum as static.
> >>>
> >>> public class Event {
> >>>     public *static* enum EventType {TYPE1, TYPE2 };
> >>>
> >>>
> >>> Andrew Dashin wrote:
> >>>> Lance пишет:
> >>>>> dwr.xml
> >>>>>
> >>>>> <allow>
> >>>>>     <convert converter="enum" match="mypackage.EventType"/>
> >>>>> </allow>
> >>>>>
> >>>>> Cheers,
> >>>>> Lance.
> >>>>>
> >>>>> Andrew Dashin wrote:
> >>>>>> Hi guys.
> >>>>>>
> >>>>>> I have class
> >>>>>>
> >>>>>> *public class* Event {
> >>>>>>
> >>>>>>  *public enum* EventType {TYPE1, TYPE2};
> >>>>>>
> >>>>>>  *private *EventType type;
> >>>>>>
> >>>>>> * public *EventType getEventType() {
> >>>>>>     *return this*.type;
> >>>>>>  }
> >>>>>>
> >>>>>> }
> >>>>>>
> >>>>>> I've defined this class as converter, and during work it fails with:
> >>>>>> No converter found for Event.EventType.
> >>>>>> So client recieves Event objects with type == null.
> >>>>>>
> >>>>>> Could you please advise me anything?
> >>>>>>
> >>>> This works only when EventType is in a separate file, but when it is
> >>>> an inner class of Event - it doesn't work.
> >>>> Even if I try
> >>>> <allow>
> >>>>    <convert converter="enum" match="Event.EventType"/>
> >>>> </allow>
> >>>>
> >>>> So I've made it as a separate class. But anyway it is interesting if
> >>>> there is a way to make it work as an inner class.
> >>>>
> >> I've tried this a time ago - doesn't work.
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/DWR-and-Enum-tp11960744p25996923.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: DWR and Enum

by Lance Java :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can be forgiven for not following this... it's from many months ago... possibly a year. I'm not sure that wildcard matching maches inner classes (or inner enums)... I could be wrong.

2009/10/21 Jose Noheda <jose.noheda@...>
Usually ** matches all classes but I have not been following the conversation

Regards


On Wed, Oct 21, 2009 at 7:38 PM, nbourdeau <nbourdeau@...> wrote:

This is working but is it possible to use wildcards for including any inner
class in a package ??

like this :

<convert converter="enum" match="mypackage.*$*"/>

or do we have to configure a convert for each inner class ??


Lance Semmens-3 wrote:
>
> Ok, last try.
> Enum must be static, use "$" instead of "."
>
> <allow>
>     <convert converter="enum" match="Event$EventType"/>
> </allow>
>
> Should work.
>
> Andrew Dashin wrote:
>> Lance пишет:
>>> In your example, EventType is not static. Therefore for EventType to
>>> exist, an Event must exist.
>>> Try declaring your inner enum as static.
>>>
>>> public class Event {
>>>     public *static* enum EventType {TYPE1, TYPE2 };
>>>
>>>
>>> Andrew Dashin wrote:
>>>> Lance пишет:
>>>>> dwr.xml
>>>>>
>>>>> <allow>
>>>>>     <convert converter="enum" match="mypackage.EventType"/>
>>>>> </allow>
>>>>>
>>>>> Cheers,
>>>>> Lance.
>>>>>
>>>>> Andrew Dashin wrote:
>>>>>> Hi guys.
>>>>>>
>>>>>> I have class
>>>>>>
>>>>>> *public class* Event {
>>>>>>
>>>>>>  *public enum* EventType {TYPE1, TYPE2};
>>>>>>
>>>>>>  *private *EventType type;
>>>>>>
>>>>>> * public *EventType getEventType() {
>>>>>>     *return this*.type;
>>>>>>  }
>>>>>>
>>>>>> }
>>>>>>
>>>>>> I've defined this class as converter, and during work it fails with:
>>>>>> No converter found for Event.EventType.
>>>>>> So client recieves Event objects with type == null.
>>>>>>
>>>>>> Could you please advise me anything?
>>>>>>
>>>> This works only when EventType is in a separate file, but when it is
>>>> an inner class of Event - it doesn't work.
>>>> Even if I try
>>>> <allow>
>>>>    <convert converter="enum" match="Event.EventType"/>
>>>> </allow>
>>>>
>>>> So I've made it as a separate class. But anyway it is interesting if
>>>> there is a way to make it work as an inner class.
>>>>
>> I've tried this a time ago - doesn't work.
>>
>
>

--
View this message in context: http://www.nabble.com/DWR-and-Enum-tp11960744p25996923.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...