Created
July 24, 2017 20:57
-
-
Save tiagobento/9bbdcd259f19c474c28d97b404d3942b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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