org.mule.module.json.transformers
Class JsonSchemaValidationFilter
java.lang.Object
org.mule.module.xml.filters.AbstractJaxpFilter
org.mule.module.xml.filters.SchemaValidationFilter
org.mule.module.json.transformers.JsonSchemaValidationFilter
- All Implemented Interfaces:
- MuleContextAware, Initialisable, Filter
public class JsonSchemaValidationFilter
- extends SchemaValidationFilter
- implements MuleContextAware
Validate a JSON string against an XML schema.
Note:
Ideally, this would call the Validator using STAX. Unfortunately,
1. xalan.jar is needed to avoid bugs in the version of Xalan built into the JRE
2. Xalan does not work with STAX
3. Having Xalan in the classpath overrides the default (STAX-compliant) factories for transformations, validators,
etc with ones that aren't STAX-compliant
The result is that, while the ideal would be to implement this class by validating a STAXSource, that won't be
possible until either we can assume a JRE with bith STAX and a working Xalan fork, or there';s a xalan.jar
that supports StAX.
| Methods inherited from class org.mule.module.xml.filters.SchemaValidationFilter |
createValidator, getDelayedResult, getErrorHandler, getResourceResolver, getSchemaLanguage, getSchemaLocations, getSchemaObject, getValidatorFeatures, getValidatorProperties, getXMLInputFactory, isReturnResult, isUseStaxSource, loadSchemaStream, loadSource, setErrorHandler, setResourceResolver, setReturnResult, setSchemaLanguage, setSchemaLocations, setSchemaObject, setUseStaxSource, setValidatorFeatures, setValidatorProperties, setXMLInputFactory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
muleContext
protected MuleContext muleContext
jToX
protected JsonToXml jToX
JsonSchemaValidationFilter
public JsonSchemaValidationFilter()
accept
public boolean accept(MuleMessage msg)
- Specified by:
accept in interface Filter- Overrides:
accept in class SchemaValidationFilter
setMuleContext
public void setMuleContext(MuleContext muleContext)
- Specified by:
setMuleContext in interface MuleContextAware
initialise
public void initialise()
throws InitialisationException
- Specified by:
initialise in interface Initialisable- Overrides:
initialise in class SchemaValidationFilter
- Throws:
InitialisationException
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.