Class JsonContentCanonicalizer
- java.lang.Object
-
- io.apicurio.registry.content.canon.JsonContentCanonicalizer
-
- All Implemented Interfaces:
ContentCanonicalizer
- Direct Known Subclasses:
KafkaConnectContentCanonicalizer
public class JsonContentCanonicalizer extends Object implements ContentCanonicalizer
A common JSON content canonicalizer. This will remove any extra formatting such as whitespace and also sort all fields/properties for all objects (because ordering of properties does not matter in JSON).- Author:
- eric.wittmann@gmail.com
-
-
Constructor Summary
Constructors Constructor Description JsonContentCanonicalizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentHandle
canonicalize(ContentHandle content)
Called to convert the given content to its canonical form.protected void
processJsonNode(com.fasterxml.jackson.databind.JsonNode node)
Perform any additional processing on the JSON node.
-
-
-
Method Detail
-
canonicalize
public ContentHandle canonicalize(ContentHandle content)
Description copied from interface:ContentCanonicalizer
Called to convert the given content to its canonical form.- Specified by:
canonicalize
in interfaceContentCanonicalizer
- See Also:
ContentCanonicalizer.canonicalize(io.apicurio.registry.content.ContentHandle)
-
processJsonNode
protected void processJsonNode(com.fasterxml.jackson.databind.JsonNode node)
Perform any additional processing on the JSON node. The base JSON canonicalizer does nothing extra.- Parameters:
node
-
-
-