下面列出了怎么用com.fasterxml.jackson.databind.ser.impl.BeanAsArraySerializer的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Implementation has to check whether as-array serialization
* is possible reliably; if (and only if) so, will construct
* a {@link BeanAsArraySerializer}, otherwise will return this
* serializer as is.
*/
@Override
protected BeanSerializerBase asArraySerializer()
{
/* Cannot:
*
* - have Object Id (may be allowed in future)
* - have "any getter"
* - have per-property filters
*/
if ((_objectIdWriter == null)
&& (_anyGetterWriter == null)
&& (_propertyFilterId == null)
) {
return new BeanAsArraySerializer(this);
}
// already is one, so:
return this;
}
@Override
protected BeanSerializerBase asArraySerializer() {
if ((_objectIdWriter == null)
&& (_anyGetterWriter == null)
&& (_propertyFilterId == null)
) {
return new BeanAsArraySerializer(this);
}
// already is one, so:
return this;
}
@Override
protected BeanSerializerBase asArraySerializer() {
return (this._objectIdWriter == null && this._anyGetterWriter == null && this._propertyFilterId == null ? new BeanAsArraySerializer(this) : this);
}