Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start implementing "content nulls" handling for some of collections
- Loading branch information
1 parent
2e9df7d
commit ca3ef05
Showing
12 changed files
with
336 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/com/fasterxml/jackson/databind/deser/impl/NullsConstantProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,34 @@ | |||
package com.fasterxml.jackson.databind.deser.impl; | |||
|
|||
import com.fasterxml.jackson.databind.*; | |||
import com.fasterxml.jackson.databind.deser.NullValueProvider; | |||
import com.fasterxml.jackson.databind.exc.InvalidNullException; | |||
|
|||
/** | |||
* Simple {@link NullValueProvider} that will always throw a | |||
* {@link InvalidNullException} when a null is encountered. | |||
*/ | |||
public class NullsConstantProvider implements NullValueProvider | |||
{ | |||
private final static NullsConstantProvider SKIPPER = new NullsConstantProvider(NullValueProvider.SKIP_MARKER); | |||
|
|||
protected final Object _nullValue; | |||
|
|||
public NullsConstantProvider(Object nvl) { | |||
_nullValue = nvl; | |||
} | |||
|
|||
/** | |||
* Static accessor for a stateless instance that always returns | |||
* {@link NullValueProvider#SKIP_MARKER} marker instance, used to indicate | |||
* that null value is to be skipped instead of replacing it. | |||
*/ | |||
public static NullsConstantProvider skipper() { | |||
return SKIPPER; | |||
} | |||
|
|||
@Override | |||
public Object getNullValue(DeserializationContext ctxt) { | |||
return _nullValue; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.