Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tiagobento/9bbdcd259f19c474c28d97b404d3942b to your computer and use it in GitHub Desktop.
Save tiagobento/9bbdcd259f19c474c28d97b404d3942b to your computer and use it in GitHub Desktop.
@ClientMarshaller(CustomMarshallerServicePojo.class)
@ServerMarshaller(CustomMarshallerServicePojo.class)
public class CustomMarshallerServicePojoMarshaller implements Marshaller<CustomMarshallerServicePojo> {
@Override
public CustomMarshallerServicePojo demarshall(EJValue o, MarshallingSession ctx) {
String[] split = o.isString().stringValue().split(",");
return new CustomMarshallerServicePojo(split[0], split[1]);
}
@Override
public String marshall(CustomMarshallerServicePojo o, MarshallingSession ctx) {
return o.getFoo() + "," + o.getBar();
}
@Override
public CustomMarshallerServicePojo[] getEmptyArray() {
return new CustomMarshallerServicePojo[0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment