|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.builder.xml.XsltBuilder
public class XsltBuilder
Creates a Processor which performs an XSLT transformation of the IN message body.
Will by default output the result as a String. You can chose which kind of output you want using the outputXXX methods.
Constructor Summary | |
---|---|
XsltBuilder()
|
|
XsltBuilder(Templates templates)
|
Method Summary | |
---|---|
protected void |
addParameters(Transformer transformer,
Map<String,Object> map)
|
XsltBuilder |
allowStAX()
Enables to allow using StAX. |
protected void |
configureTransformer(Transformer transformer,
Exchange exchange)
Configures the transformer with exchange specific parameters |
XsltBuilder |
deleteOutputFile()
Should the output file be deleted when the Exchange is done. |
XmlConverter |
getConverter()
|
ErrorListener |
getErrorListener()
|
Map<String,Object> |
getParameters()
|
ResultHandlerFactory |
getResultHandlerFactory()
|
protected Source |
getSource(Exchange exchange,
Object body)
Converts the inbound body to a Source , if the body is not already a Source . |
Templates |
getTemplate()
|
URIResolver |
getUriResolver()
|
boolean |
isAllowStAX()
|
boolean |
isDeleteOutputFile()
|
boolean |
isFailOnNullBody()
|
protected boolean |
isInputStreamNeeded(Exchange exchange)
Checks whether we need an InputStream to access the message body. |
XsltBuilder |
outputBytes()
Sets the output as being a byte[] |
XsltBuilder |
outputDOM()
Sets the output as being a DOM |
XsltBuilder |
outputFile()
Sets the output as being a File where the filename must be provided in the Exchange.XSLT_FILE_NAME header. |
XsltBuilder |
outputString()
Sets the output as being a String |
XsltBuilder |
parameter(String name,
Object value)
|
void |
process(Exchange exchange)
Processes the message exchange |
void |
setAllowStAX(boolean allowStAX)
|
void |
setConverter(XmlConverter converter)
|
void |
setDeleteOutputFile(boolean deleteOutputFile)
|
void |
setErrorListener(ErrorListener errorListener)
|
void |
setFailOnNullBody(boolean failOnNullBody)
|
void |
setParameters(Map<String,Object> parameters)
|
void |
setResultHandlerFactory(ResultHandlerFactory resultHandlerFactory)
|
void |
setTemplate(Templates template)
|
void |
setTransformerFile(File xslt)
Sets the XSLT transformer from a File |
void |
setTransformerInputStream(InputStream in)
Sets the XSLT transformer from the given input stream |
void |
setTransformerSource(Source source)
Sets the XSLT transformer from a Source |
void |
setTransformerURL(URL url)
Sets the XSLT transformer from a URL |
void |
setUriResolver(URIResolver uriResolver)
|
String |
toString()
|
XsltBuilder |
transformerCacheSize(int numberToCache)
|
XsltBuilder |
uriResolver(URIResolver uriResolver)
Sets a custom URI resolver to be used |
static XsltBuilder |
xslt(File xslt)
Creates an XSLT processor using the given XSLT source |
static XsltBuilder |
xslt(InputStream xslt)
Creates an XSLT processor using the given XSLT source |
static XsltBuilder |
xslt(Source xslt)
Creates an XSLT processor using the given XSLT source |
static XsltBuilder |
xslt(Templates templates)
Creates an XSLT processor using the given templates instance |
static XsltBuilder |
xslt(URL xslt)
Creates an XSLT processor using the given XSLT source |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XsltBuilder()
public XsltBuilder(Templates templates)
Method Detail |
---|
public String toString()
toString
in class Object
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 static XsltBuilder xslt(Templates templates)
public static XsltBuilder xslt(Source xslt) throws TransformerConfigurationException
TransformerConfigurationException
public static XsltBuilder xslt(File xslt) throws TransformerConfigurationException
TransformerConfigurationException
public static XsltBuilder xslt(URL xslt) throws TransformerConfigurationException, IOException
TransformerConfigurationException
IOException
public static XsltBuilder xslt(InputStream xslt) throws TransformerConfigurationException, IOException
TransformerConfigurationException
IOException
public XsltBuilder outputBytes()
public XsltBuilder outputString()
public XsltBuilder outputDOM()
public XsltBuilder outputFile()
Exchange.XSLT_FILE_NAME
header.
public XsltBuilder deleteOutputFile()
Exchange
is done.
This option should only be used if you use outputFile()
as well.
public XsltBuilder parameter(String name, Object value)
public XsltBuilder uriResolver(URIResolver uriResolver)
public XsltBuilder allowStAX()
Source
.
public XsltBuilder transformerCacheSize(int numberToCache)
public Map<String,Object> getParameters()
public void setParameters(Map<String,Object> parameters)
public void setTemplate(Templates template)
public Templates getTemplate()
public boolean isFailOnNullBody()
public void setFailOnNullBody(boolean failOnNullBody)
public ResultHandlerFactory getResultHandlerFactory()
public void setResultHandlerFactory(ResultHandlerFactory resultHandlerFactory)
public boolean isAllowStAX()
public void setAllowStAX(boolean allowStAX)
public void setTransformerSource(Source source) throws TransformerConfigurationException
source
- the source
TransformerConfigurationException
- is thrown if creating a XSLT transformer failed.public void setTransformerFile(File xslt) throws TransformerConfigurationException
TransformerConfigurationException
public void setTransformerURL(URL url) throws TransformerConfigurationException, IOException
TransformerConfigurationException
IOException
public void setTransformerInputStream(InputStream in) throws TransformerConfigurationException, IOException
TransformerConfigurationException
IOException
public XmlConverter getConverter()
public void setConverter(XmlConverter converter)
public URIResolver getUriResolver()
public void setUriResolver(URIResolver uriResolver)
public boolean isDeleteOutputFile()
public void setDeleteOutputFile(boolean deleteOutputFile)
public ErrorListener getErrorListener()
public void setErrorListener(ErrorListener errorListener)
protected boolean isInputStreamNeeded(Exchange exchange)
InputStream
to access the message body.
Depending on the content in the message body, we may not need to convert
to InputStream
.
exchange
- the current exchange
InputStream
beforehand converting to Source
afterwards.protected Source getSource(Exchange exchange, Object body)
Source
, if the body is not already a Source
.
This implementation will prefer to source in the following order:
protected void configureTransformer(Transformer transformer, Exchange exchange)
protected void addParameters(Transformer transformer, Map<String,Object> map)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |