[errai-dev] Errai marshalling + enum collections
Christian Sadilek
csadilek at redhat.com
Wed Oct 1 14:28:22 EDT 2014
Yes it does, but this is a bug. I will try and fix it for the 3.0.3.Final release, planned for next week.
Thanks,
Christian
On 2014-09-30, at 4:42 PM, Eric Wittmann <eric.wittmann at redhat.com> wrote:
> Does the marshalling framework support collections of Enums? I have an
> @Portable bean like this:
>
> @Portable
> public class RoleBean implements Serializable {
>
> private static final long serialVersionUID = -646534082583069712L;
>
> private String id;
> private String name;
> private Set<PermissionType> permissions;
>
> }
>
> Where PermissionType is a very simple java enum. It *used* to be a
> Set<String> which of course worked fine. But I recently changed it and
> now the errai marshaller is having fits. I'm using Errai's jax-rs
> support and the remote REST endpoint returns plain jackson style JSON,
> so there are no type hints.
>
> The generated marshaller includes this code:
>
> if ((obj.containsKey("permissions")) &&
> (!obj.get("permissions").isNull())) {
>
> a1.setAssumedElementType("org.overlord.apiman.dt.api.beans.idm.PermissionType");
>
> entity.setPermissions(java_util_Set.demarshall(obj.get("permissions"), a1));
> }
>
> But when it gets into AbstractCollectionMarshaller I think the assumed
> element type is only used for beans, not for enums.
>
> -Eric
>
>
> _______________________________________________
> errai-dev mailing list
> errai-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/errai-dev
More information about the errai-dev
mailing list