/** * Helper method called to see if we need a comparator Object to check if values * of a container (Collection, array) property should be suppressed. * This is usually * * @param propertyName Name of property to handle * @param propertyType Declared type of values of the property to handle * @return Object whose <code>equals()</code> method is called to check if given value * is "empty Collection" value to suppress; or null if no such check should be done * (declared type not Collection or array) * * @since 1.9 */ protected Object getContainerValueChecker(String propertyName, JavaType propertyType) { // currently we will only check for certain kinds of empty containers: if (!_config.isEnabled(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS)) { if (propertyType.isArrayType()) { return new EmptyArrayChecker(); } if (Collection.class.isAssignableFrom(propertyType.getRawClass())) { return new EmptyCollectionChecker(); } } return null; }
/** * Helper method called to see if we need a comparator Object to check if values * of a container (Collection, array) property should be suppressed. * This is usually * * @param propertyName Name of property to handle * @param propertyType Declared type of values of the property to handle * @return Object whose <code>equals()</code> method is called to check if given value * is "empty Collection" value to suppress; or null if no such check should be done * (declared type not Collection or array) * * @since 1.9 */ protected Object getContainerValueChecker(String propertyName, JavaType propertyType) { // currently we will only check for certain kinds of empty containers: if (!_config.isEnabled(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS)) { if (propertyType.isArrayType()) { return new EmptyArrayChecker(); } if (Collection.class.isAssignableFrom(propertyType.getRawClass())) { return new EmptyCollectionChecker(); } } return null; }
/** * Helper method called to see if we need a comparator Object to check if values * of a container (Collection, array) property should be suppressed. * This is usually * * @param propertyName Name of property to handle * @param propertyType Declared type of values of the property to handle * @return Object whose <code>equals()</code> method is called to check if given value * is "empty Collection" value to suppress; or null if no such check should be done * (declared type not Collection or array) * * @since 1.9 */ protected Object getContainerValueChecker(String propertyName, JavaType propertyType) { // currently we will only check for certain kinds of empty containers: if (!_config.isEnabled(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS)) { if (propertyType.isArrayType()) { return new EmptyArrayChecker(); } if (Collection.class.isAssignableFrom(propertyType.getRawClass())) { return new EmptyCollectionChecker(); } } return null; }
/** * Helper method called to see if we need a comparator Object to check if values * of a container (Collection, array) property should be suppressed. * This is usually * * @param propertyName Name of property to handle * @param propertyType Declared type of values of the property to handle * @return Object whose <code>equals()</code> method is called to check if given value * is "empty Collection" value to suppress; or null if no such check should be done * (declared type not Collection or array) * * @since 1.9 */ protected Object getContainerValueChecker(String propertyName, JavaType propertyType) { // currently we will only check for certain kinds of empty containers: if (!_config.isEnabled(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS)) { if (propertyType.isArrayType()) { return new EmptyArrayChecker(); } if (Collection.class.isAssignableFrom(propertyType.getRawClass())) { return new EmptyCollectionChecker(); } } return null; }