Created
July 4, 2017 09:31
-
-
Save circlee/46b4354a21013c5b57af1512048cf6b6 to your computer and use it in GitHub Desktop.
XssStringDeserializer
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
import java.io.IOException; | |
import com.fasterxml.jackson.core.JsonParser; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.DeserializationContext; | |
import com.fasterxml.jackson.databind.JsonDeserializer; | |
public class XssStringDeserializer extends JsonDeserializer<String> { | |
@Override | |
public String deserialize(JsonParser p, DeserializationContext ctxt) | |
throws IOException, JsonProcessingException { | |
// origin value | |
String origin = p.getValueAsString(); | |
String replaced = origin + " <- deserialized"; | |
return replaced; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment