|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.processor.validation.ValidatingProcessor
public class ValidatingProcessor
A processor which validates the XML version of the inbound message body against some schema either in XSD or RelaxNG
Constructor Summary | |
---|---|
ValidatingProcessor()
|
Method Summary | |
---|---|
protected Schema |
createSchema()
|
protected SchemaFactory |
createSchemaFactory()
|
protected Source |
createSchemaSource()
|
protected void |
doProcess(Exchange exchange)
|
ValidatorErrorHandler |
getErrorHandler()
|
String |
getHeaderName()
|
LSResourceResolver |
getResourceResolver()
|
Schema |
getSchema()
|
byte[] |
getSchemaAsByteArray()
|
SchemaFactory |
getSchemaFactory()
|
File |
getSchemaFile()
|
String |
getSchemaLanguage()
|
Source |
getSchemaSource()
|
URL |
getSchemaUrl()
|
protected Source |
getSource(Exchange exchange,
Object content)
Converts the inbound body or header to a Source , if it is not already a Source . |
boolean |
isFailOnNullBody()
|
boolean |
isFailOnNullHeader()
|
protected boolean |
isInputStreamNeeded(Exchange exchange)
Checks whether we need an InputStream to access the message body or header. |
boolean |
isUseDom()
Deprecated. |
boolean |
isUseSharedSchema()
|
void |
loadSchema()
|
void |
process(Exchange exchange)
Processes the message exchange |
boolean |
process(Exchange exchange,
AsyncCallback callback)
Processes the message exchange. |
void |
setErrorHandler(ValidatorErrorHandler errorHandler)
|
void |
setFailOnNullBody(boolean failOnNullBody)
|
void |
setFailOnNullHeader(boolean failOnNullHeader)
|
void |
setHeaderName(String headerName)
|
void |
setResourceResolver(LSResourceResolver resourceResolver)
|
void |
setSchema(Schema schema)
|
void |
setSchemaAsByteArray(byte[] schemaAsByteArray)
|
void |
setSchemaFactory(SchemaFactory schemaFactory)
|
void |
setSchemaFile(File schemaFile)
|
void |
setSchemaLanguage(String schemaLanguage)
|
void |
setSchemaSource(Source schemaSource)
|
void |
setSchemaUrl(URL schemaUrl)
|
void |
setUseDom(boolean useDom)
Deprecated. |
void |
setUseSharedSchema(boolean useSharedSchema)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValidatingProcessor()
Method Detail |
---|
public void process(Exchange exchange) throws Exception
Processor
process
in interface Processor
exchange
- the message exchange
Exception
- if an internal processing error has occurred.public boolean process(Exchange exchange, AsyncCallback callback)
AsyncProcessor
Processor.process(org.apache.camel.Exchange)
, but the caller supports having the exchange asynchronously processed.
If there was a failure processing then the caused Exception
would be set on the Exchange
.
process
in interface AsyncProcessor
exchange
- the message exchangecallback
- the AsyncCallback
will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.
protected void doProcess(Exchange exchange) throws Exception
Exception
public void loadSchema() throws Exception
Exception
public Schema getSchema() throws IOException, SAXException
IOException
SAXException
public void setSchema(Schema schema)
public String getSchemaLanguage()
public void setSchemaLanguage(String schemaLanguage)
public Source getSchemaSource() throws IOException
IOException
public void setSchemaSource(Source schemaSource)
public URL getSchemaUrl()
public void setSchemaUrl(URL schemaUrl)
public File getSchemaFile()
public void setSchemaFile(File schemaFile)
public byte[] getSchemaAsByteArray()
public void setSchemaAsByteArray(byte[] schemaAsByteArray)
public SchemaFactory getSchemaFactory()
public void setSchemaFactory(SchemaFactory schemaFactory)
public ValidatorErrorHandler getErrorHandler()
public void setErrorHandler(ValidatorErrorHandler errorHandler)
@Deprecated public boolean isUseDom()
@Deprecated public void setUseDom(boolean useDom)
useDom
- true to use DOM otherwisepublic boolean isUseSharedSchema()
public void setUseSharedSchema(boolean useSharedSchema)
public LSResourceResolver getResourceResolver()
public void setResourceResolver(LSResourceResolver resourceResolver)
public boolean isFailOnNullBody()
public void setFailOnNullBody(boolean failOnNullBody)
public boolean isFailOnNullHeader()
public void setFailOnNullHeader(boolean failOnNullHeader)
public String getHeaderName()
public void setHeaderName(String headerName)
protected SchemaFactory createSchemaFactory()
protected Source createSchemaSource() throws IOException
IOException
protected Schema createSchema() throws SAXException, IOException
SAXException
IOException
protected boolean isInputStreamNeeded(Exchange exchange)
InputStream
to access the message body or header.
Depending on the content in the message body or header, we may not need to convert
to InputStream
.
exchange
- the current exchange
InputStream
beforehand converting to Source
afterwards.protected Source getSource(Exchange exchange, Object content)
Source
, if it is not already a Source
.
This implementation will prefer to source in the following order:
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |