Class SmooksProcessor
java.lang.Object
org.smooks.cartridges.camel.processor.SmooksProcessor
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.Processor,org.apache.camel.Service,org.apache.camel.spi.HasCamelContext
public class SmooksProcessor
extends Object
implements org.apache.camel.Processor, org.apache.camel.Service, org.apache.camel.CamelContextAware
Smooks
Processor for Camel.- Author:
- Christian Mueller, Daniel Bevenius
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSmooksProcessor(String configUri, org.apache.camel.CamelContext camelContext) SmooksProcessor(org.apache.camel.CamelContext camelContext) SmooksProcessor(org.smooks.Smooks smooks, org.apache.camel.CamelContext camelContext) -
Method Summary
Modifier and TypeMethodDescriptionaddVisitor(org.smooks.api.delivery.VisitorAppender appender) Add a visitor instance tothisSmooks instance via aVisitorAppender.addVisitor(org.smooks.api.resource.visitor.Visitor visitor, String targetSelector) Add a visitor instance.org.apache.camel.CamelContextvoidprocess(org.apache.camel.Exchange exchange) voidsetCamelContext(org.apache.camel.CamelContext camelContext) voidsetReportPath(String reportPath) protected voidsetResultOnBody(org.smooks.io.payload.Exports exports, Result[] results, org.apache.camel.Exchange exchange) voidsetSmooksConfig(String smooksConfig) voidstart()voidstop()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init
-
Field Details
-
SMOOKS_EXECUTION_CONTEXT
- See Also:
-
CAMEL_CHARACTER_ENCODING
- See Also:
-
EXCHANGE_TYPED_KEY
public static final org.smooks.api.TypedKey<org.apache.camel.Exchange> EXCHANGE_TYPED_KEY
-
-
Constructor Details
-
SmooksProcessor
public SmooksProcessor(org.apache.camel.CamelContext camelContext) -
SmooksProcessor
public SmooksProcessor(org.smooks.Smooks smooks, org.apache.camel.CamelContext camelContext) -
SmooksProcessor
public SmooksProcessor(String configUri, org.apache.camel.CamelContext camelContext) throws IOException, SAXException - Throws:
IOExceptionSAXException
-
-
Method Details
-
process
public void process(org.apache.camel.Exchange exchange) - Specified by:
processin interfaceorg.apache.camel.Processor
-
setResultOnBody
protected void setResultOnBody(org.smooks.io.payload.Exports exports, Result[] results, org.apache.camel.Exchange exchange) -
getSmooksConfig
-
setSmooksConfig
-
addVisitor
public SmooksProcessor addVisitor(org.smooks.api.resource.visitor.Visitor visitor, String targetSelector) Add a visitor instance.- Parameters:
visitor- The visitor implementation.targetSelector- The message fragment target selector.- Returns:
- This instance.
-
addVisitor
Add a visitor instance tothisSmooks instance via aVisitorAppender.- Parameters:
appender- The visitor appender.- Returns:
- This instance.
-
setReportPath
-
start
public void start()- Specified by:
startin interfaceorg.apache.camel.Service
-
stop
public void stop()- Specified by:
stopin interfaceorg.apache.camel.Service
-
toString
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-