@ManagedResource(description="Managed ValidatorEndpoint") @UriEndpoint(firstVersion="1.1.0", scheme="validator", title="Validator", syntax="validator:resourceUri", producerOnly=true, label="core,validation") public class ValidatorEndpoint extends DefaultEndpoint
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
ValidatorEndpoint() |
ValidatorEndpoint(String endpointUri,
Component component,
String resourceUri) |
Modifier and Type | Method and Description |
---|---|
void |
clearCachedSchema() |
protected void |
configureValidator(ValidatingProcessor validator) |
Consumer |
createConsumer(Processor processor)
Creates a new Event
Driven Consumer which consumes messages from the endpoint using the
given processor
|
Producer |
createProducer()
Creates a new producer which is used send messages into the endpoint
|
ValidatorErrorHandler |
getErrorHandler() |
String |
getHeaderName() |
LSResourceResolver |
getResourceResolver() |
ValidatorResourceResolverFactory |
getResourceResolverFactory() |
String |
getResourceUri() |
SchemaFactory |
getSchemaFactory() |
String |
getSchemaLanguage() |
boolean |
isFailOnNullBody() |
boolean |
isFailOnNullHeader() |
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
boolean |
isUseDom() |
boolean |
isUseSharedSchema() |
void |
setErrorHandler(ValidatorErrorHandler errorHandler)
To use a custom org.apache.camel.processor.validation.ValidatorErrorHandler.
|
void |
setFailOnNullBody(boolean failOnNullBody)
Whether to fail if no body exists.
|
void |
setFailOnNullHeader(boolean failOnNullHeader)
Whether to fail if no header exists when validating against a header.
|
void |
setHeaderName(String headerName)
To validate against a header instead of the message body.
|
void |
setResourceResolver(LSResourceResolver resourceResolver)
To use a custom LSResourceResolver.
|
void |
setResourceResolverFactory(ValidatorResourceResolverFactory resourceResolverFactory)
For creating a resource resolver which depends on the endpoint resource URI.
|
void |
setResourceUri(String resourceUri)
URL to a local resource on the classpath,or a reference to lookup a bean in the Registry,
or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.
|
void |
setSchemaFactory(SchemaFactory schemaFactory)
To use a custom javax.xml.validation.SchemaFactory
|
void |
setSchemaLanguage(String schemaLanguage)
Configures the W3C XML Schema Namespace URI.
|
void |
setUseDom(boolean useDom)
Whether DOMSource/DOMResult or SaxSource/SaxResult should be used by the validator.
|
void |
setUseSharedSchema(boolean useSharedSchema)
Whether the Schema instance should be shared or not.
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public ValidatorEndpoint()
public ValidatorEndpoint(String endpointUri, Component component, String resourceUri)
@ManagedOperation(description="Clears the cached schema, forcing to re-load the schema on next request") public void clearCachedSchema()
public Producer createProducer() throws Exception
Endpoint
Exception
- can be thrownpublic Consumer createConsumer(Processor processor) throws Exception
Endpoint
processor
- the given processorException
- can be thrownpublic boolean isSingleton()
IsSingleton
protected void configureValidator(ValidatingProcessor validator) throws Exception
Exception
public String getResourceUri()
public void setResourceUri(String resourceUri)
public String getSchemaLanguage()
public void setSchemaLanguage(String schemaLanguage)
public SchemaFactory getSchemaFactory()
public void setSchemaFactory(SchemaFactory schemaFactory)
public ValidatorErrorHandler getErrorHandler()
public void setErrorHandler(ValidatorErrorHandler errorHandler)
public boolean isUseDom()
public void setUseDom(boolean useDom)
public boolean isUseSharedSchema()
public void setUseSharedSchema(boolean useSharedSchema)
public LSResourceResolver getResourceResolver()
public void setResourceResolver(LSResourceResolver resourceResolver)
setResourceResolverFactory(ValidatorResourceResolverFactory)
public ValidatorResourceResolverFactory getResourceResolverFactory()
public void setResourceResolverFactory(ValidatorResourceResolverFactory resourceResolverFactory)
setResourceResolver(LSResourceResolver)
.
If not set then DefaultValidatorResourceResolverFactory
is usedpublic boolean isFailOnNullBody()
public void setFailOnNullBody(boolean failOnNullBody)
public boolean isFailOnNullHeader()
public void setFailOnNullHeader(boolean failOnNullHeader)
public String getHeaderName()
public void setHeaderName(String headerName)
Apache Camel