-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More reworking of #2195 implementation
- Loading branch information
1 parent
c456a08
commit 03dd8cd
Showing
10 changed files
with
245 additions
and
71 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
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
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/fasterxml/jackson/databind/jsontype/impl/LaissezFaireSubTypeValidator.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.fasterxml.jackson.databind.jsontype.impl; | ||
|
||
import com.fasterxml.jackson.databind.JavaType; | ||
import com.fasterxml.jackson.databind.cfg.MapperConfig; | ||
import com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator; | ||
|
||
/** | ||
* Default {@link PolymorphicTypeValidator} used unless explicit one is constructed. | ||
* Does not do any validation, allows all subtypes. Only used for backwards-compatibility | ||
* reasons: users should not usually use such a permissive implementation but use | ||
* allow-list/criteria - based implementation. | ||
* | ||
* @since 2.10 | ||
*/ | ||
public final class LaissezFaireSubTypeValidator | ||
extends PolymorphicTypeValidator | ||
{ | ||
private static final long serialVersionUID = 1L; | ||
|
||
public final static LaissezFaireSubTypeValidator instance = new LaissezFaireSubTypeValidator(); | ||
|
||
@Override | ||
public Validity validateBaseType(MapperConfig<?> ctxt, JavaType baseType) { | ||
return Validity.INDETERMINATE; | ||
} | ||
|
||
@Override | ||
public Validity validateSubClassName(MapperConfig<?> ctxt, | ||
JavaType baseType, String subClassName) { | ||
return Validity.ALLOWED; | ||
} | ||
|
||
@Override | ||
public Validity validateSubType(MapperConfig<?> ctxt, JavaType baseType, | ||
JavaType subType) { | ||
return Validity.ALLOWED; | ||
} | ||
} |
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.