Class Xml2JsonInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.xml.Xml2JsonInterceptor
- All Implemented Interfaces:
Interceptor
- Description
- If enabled converts body content from xml to json.
- Explanation
- Can be used for both request and response. Xml file assumed to be in UTF-8. If input is invalid it returns empty json object.
- Topic
- 4. Interceptors/Features
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdocumentToString(Document doc) handleRequest(Exchange exc) handleResponse(Exchange exc) static StringloadXMLFromStream(InputStream stream) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, init, init, setDisplayName, setFlow
-
Constructor Details
-
Xml2JsonInterceptor
public Xml2JsonInterceptor()
-
-
Method Details
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
handleResponse
- Specified by:
handleResponsein interfaceInterceptor- Overrides:
handleResponsein classAbstractInterceptor- Throws:
Exception
-
loadXMLFromStream
- Throws:
Exception
-
documentToString
-
getDisplayName
- Specified by:
getDisplayNamein interfaceInterceptor- Overrides:
getDisplayNamein classAbstractInterceptor
-