juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bognar (Jira)" <j...@apache.org>
Subject [jira] [Created] (JUNEAU-224) Add @Parse and @Serialize annotations.
Date Wed, 06 May 2020 14:14:00 GMT
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)

Mime
View raw message