-
Notifications
You must be signed in to change notification settings - Fork 12
@JsonCreator
JonathanO edited this page Jun 3, 2012
·
5 revisions
Used on the constructor or a static method to mark it as the factory method for this object. It optionally takes a single argument consisting of an array of @JsonProperty annotations, which will be used in specified order as the parameters to the factory/constructor.
When de-serializing the JsonCreator will be called to instantiate the object, and will be passed the specified properties from the JSON.
- params (JsonProperty[]) The properties to be used as parameters to the annotated method, in order.
Construct this object using the constructor, with a single argument populated from JSON property "foo"
<?
/**
* @JsonCreator({@JsonProperty(name="foo", type="string)})
*/
public function __construct($foo) {