You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by "James Bognar (Jira)" <ji...@apache.org> on 2020/05/06 14:14:00 UTC
[jira] [Created] (JUNEAU-224) Add @Parse and @Serialize
annotations.
James Bognar created JUNEAU-224:
-----------------------------------
Summary: Add @Parse and @Serialize annotations.
Key: JUNEAU-224
URL: https://issues.apache.org/jira/browse/JUNEAU-224
Project: Juneau
Issue Type: Improvement
Components: Code
Affects Versions: 8.1.3
Reporter: James Bognar
Add annotations that explicitly specify which methods/constructors to use when transforming POJOs into serialized/parsed form.
{code:java}
// Use this method when serializing this POJO.
@Serialize
public String[] asStringArray() {...}
// Use this method when serializing this POJO for JSON only.
@Serialize(mediaType="*/json")
public String[] asStringArray() {...}
// Use this method when creating new Foo objects.
@Parse
public static Foo create(String[] in) {...}
// Use this constructor when creating new Foo objects.
@Parse
public Foo(String[] in) {...}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)