|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.synapse.mediators.AbstractMediator org.apache.synapse.mediators.AbstractListMediator org.apache.synapse.mediators.builtin.ValidateMediator
public class ValidateMediator
Validate a message or an element against a schema
This internally uses the Xerces2-j parser, which cautions a lot about thread-safety and memory leaks. Hence this initial implementation will create a single parser instance for each unique mediator instance, and re-use it to validate multiple messages - even concurrently - by synchronizing access
Field Summary |
---|
Fields inherited from class org.apache.synapse.mediators.AbstractListMediator |
---|
mediators |
Fields inherited from class org.apache.synapse.mediators.AbstractMediator |
---|
log, trace, traceState |
Constructor Summary | |
---|---|
ValidateMediator()
|
Method Summary | |
---|---|
void |
addFeature(String featureName,
boolean isFeatureEnable)
add a feature which need to set for the Schema Factory |
Object |
getFeature(String key)
Get a mediator feature. |
List<MediatorProperty> |
getFeatures()
Features for the actual Xerces validator |
ResourceMap |
getResourceMap()
ResourceMap for the external schema resources to be used for the validation |
List<Value> |
getSchemaKeys()
The keys for the schema resources used for validation |
SynapseXPath |
getSource()
Get the source XPath which yields the source element for validation |
boolean |
mediate(MessageContext synCtx)
Invokes the mediator passing the current message for mediation. |
void |
setResourceMap(ResourceMap resourceMap)
Set the External Schema ResourceMap that will required for schema validation |
void |
setSchemaKeys(List<Value> schemaKeys)
Set a list of local property names which refer to a list of schemas to be used for validation |
void |
setSource(SynapseXPath source)
Set the given XPath as the source XPath |
Methods inherited from class org.apache.synapse.mediators.AbstractListMediator |
---|
addAll, addChild, destroy, getChild, getList, init, removeChild, removeChild |
Methods inherited from class org.apache.synapse.mediators.AbstractMediator |
---|
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, getType, handleException, handleException, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.synapse.Mediator |
---|
getTraceState, getType, setTraceState |
Methods inherited from interface org.apache.synapse.SynapseArtifact |
---|
getDescription, setDescription |
Constructor Detail |
---|
public ValidateMediator()
Method Detail |
---|
public boolean mediate(MessageContext synCtx)
Mediator
mediate
in interface Mediator
mediate
in class AbstractListMediator
synCtx
- the current message for mediation
public Object getFeature(String key)
key
- property key / feature name
public void addFeature(String featureName, boolean isFeatureEnable) throws SAXException
featureName
- The name of the featureisFeatureEnable
- should this feature enable?(true|false)
SAXException
- on an unknown featuregetFeature(String)
public void setSchemaKeys(List<Value> schemaKeys)
schemaKeys
- list of local property namespublic void setSource(SynapseXPath source)
source
- an XPath to be set as the sourcepublic void setResourceMap(ResourceMap resourceMap)
resourceMap
- the ResourceMap which contains external schema resourcespublic SynapseXPath getSource()
public List<Value> getSchemaKeys()
public List<MediatorProperty> getFeatures()
public ResourceMap getResourceMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |