Class Dom4jDocumentJsonSerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<org.dom4j.Document>
-
- org.craftercms.core.util.json.jackson.Dom4jDocumentJsonSerializer
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
public class Dom4jDocumentJsonSerializer extends com.fasterxml.jackson.databind.JsonSerializer<org.dom4j.Document>
Custom Jackson serializer forDocument
. The following are the conversion patterns used between XML and JSON: XML JSON Access --- ---- ------"e": null o.e text "e": "text" o.e"e": { "name": "value" } o.e["name"] text "e": { "name": "value", "text": "text" } o.e["name"] o.e["text"]texttext "e": { "a": "text", "b": "text" } o.e.a o.e.btexttext "e": { "a": ["text", "text"] } o.e.a[0] o.e.a[1]texttext "e": { "text": "text", "a": "text" } o.e["text"] o.e.atexttexttext "e": { "text": ["text", "text"], "a": "text" } o.e["text"][0] o.e["text"][1] o.e.a IMPORTANT: XML Namespaces are ALWAYS ignored.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description static String[]
IGNORABLE_ATTRIBUTES
static String
ITEM_LIST_ATTRIBUTE_NAME
static String
TEXT_JSON_KEY
-
Constructor Summary
Constructors Constructor Description Dom4jDocumentJsonSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<org.dom4j.Document>
handledType()
void
serialize(org.dom4j.Document doc, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, com.fasterxml.jackson.databind.SerializerProvider provider)
-
-
-
Field Detail
-
ITEM_LIST_ATTRIBUTE_NAME
public static final String ITEM_LIST_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
IGNORABLE_ATTRIBUTES
public static final String[] IGNORABLE_ATTRIBUTES
-
TEXT_JSON_KEY
public static final String TEXT_JSON_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
serialize
public void serialize(org.dom4j.Document doc, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException
- Specified by:
serialize
in classcom.fasterxml.jackson.databind.JsonSerializer<org.dom4j.Document>
- Throws:
IOException
-
handledType
public Class<org.dom4j.Document> handledType()
- Overrides:
handledType
in classcom.fasterxml.jackson.databind.JsonSerializer<org.dom4j.Document>
-
-