com.fasterxml.jackson.databind.ser.impl.BeanAsArraySerializer Java Examples

The following examples show how to use com.fasterxml.jackson.databind.ser.impl.BeanAsArraySerializer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BeanSerializer.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #2
Source File: AbstractBeanSerializer.java    From caravan with Apache License 2.0 5 votes vote down vote up
@Override
protected BeanSerializerBase asArraySerializer() {
  if ((_objectIdWriter == null)
      && (_anyGetterWriter == null)
      && (_propertyFilterId == null)
      ) {
    return new BeanAsArraySerializer(this);
  }
  // already is one, so:
  return this;
}
 
Example #3
Source File: ExtraFieldSerializer.java    From albedo with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected BeanSerializerBase asArraySerializer() {
	return (this._objectIdWriter == null && this._anyGetterWriter == null && this._propertyFilterId == null ? new BeanAsArraySerializer(this) : this);
}