|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.imolinfo.jbi4ejb.processor.transform.SourceTransformer
public class SourceTransformer
Taken from servicemix-core SourceTransformer
and partially
from StAXSoureTransformer
class.
// TODO AddStaxSource
support
Constructor Summary | |
---|---|
SourceTransformer()
Instantiates a new source transformer. |
|
SourceTransformer(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory)
Instantiates a new source transformer. |
Method Summary | |
---|---|
java.lang.String |
contentToString(javax.jbi.messaging.NormalizedMessage message)
Converts the content of the given message to a String. |
org.w3c.dom.Document |
createDocument()
Creates the document. |
javax.xml.parsers.DocumentBuilder |
createDocumentBuilder()
Creates the document builder. |
javax.xml.parsers.DocumentBuilderFactory |
createDocumentBuilderFactory()
Creates the document builder factory. |
protected javax.xml.stream.XMLInputFactory |
createInputFactory()
Creates the input factory. |
javax.xml.transform.Transformer |
createTransfomer()
Creates the transfomer. |
javax.xml.transform.TransformerFactory |
createTransformerFactory()
Creates the transformer factory. |
javax.xml.parsers.DocumentBuilderFactory |
getDocumentBuilderFactory()
Gets the document builder factory. |
javax.xml.stream.XMLInputFactory |
getInputFactory()
Gets the input factory. |
javax.xml.transform.TransformerFactory |
getTransformerFactory()
Gets the transformer factory. |
void |
setDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory)
Sets the document builder factory. |
void |
setTransformerFactory(javax.xml.transform.TransformerFactory transformerFactory)
Sets the transformer factory. |
org.w3c.dom.Document |
toDOMDocument(org.w3c.dom.Node node)
Create a DOM document from the given Node. |
org.w3c.dom.Document |
toDOMDocument(javax.jbi.messaging.NormalizedMessage message)
Create a DOM document from the given normalized message. |
org.w3c.dom.Document |
toDOMDocument(javax.xml.transform.Source source)
Create a DOM document from the given source. |
org.w3c.dom.Element |
toDOMElement(org.w3c.dom.Node node)
Create a DOM element from the DOM node. |
org.w3c.dom.Element |
toDOMElement(javax.jbi.messaging.NormalizedMessage message)
Create a DOM element from the normalized message. |
org.w3c.dom.Element |
toDOMElement(javax.xml.transform.Source source)
Create a DOM element from the given source. |
org.w3c.dom.Node |
toDOMNode(javax.jbi.messaging.NormalizedMessage message)
Avoids multple parsing to DOM by caching the DOM representation in the message as a property so future calls will avoid the reparse - and avoid issues with stream based Source instances. |
org.w3c.dom.Node |
toDOMNode(javax.xml.transform.Source source)
Converts the given TRaX Source into a W3C DOM node. |
org.w3c.dom.Node |
toDOMNodeFromSAX(javax.xml.transform.sax.SAXSource source)
To DOM node from SAX. |
javax.xml.transform.Source |
toDOMSource(javax.jbi.messaging.NormalizedMessage message)
To DOM source. |
javax.xml.transform.dom.DOMSource |
toDOMSource(javax.xml.transform.Source source)
Converts the source instance to a DOMSource or returns null if
the conversion is not supported (making it easy to derive from this class
to add new kinds of conversion). |
javax.xml.transform.dom.DOMSource |
toDOMSourceFromSAX(javax.xml.transform.sax.SAXSource source)
To DOM source from SAX. |
javax.xml.transform.dom.DOMSource |
toDOMSourceFromStream(javax.xml.transform.stream.StreamSource source)
To DOM source from stream. |
java.io.Reader |
toReaderFromSource(javax.xml.transform.Source src)
To reader from source. |
void |
toResult(javax.xml.transform.Source source,
javax.xml.transform.Result result)
Converts the given input Source into the required result. |
javax.xml.transform.sax.SAXSource |
toSAXSource(javax.xml.transform.Source source)
Converts the source instance to a SAXSource or returns null if
the conversion is not supported (making it easy to derive from this class
to add new kinds of conversion). |
javax.xml.transform.sax.SAXSource |
toSAXSourceFromDOM(javax.xml.transform.dom.DOMSource source)
To SAX source from DOM. |
javax.xml.transform.sax.SAXSource |
toSAXSourceFromStream(javax.xml.transform.stream.StreamSource source)
To SAX source from stream. |
javax.xml.transform.stream.StreamSource |
toStreamSource(javax.xml.transform.Source source)
To stream source. |
javax.xml.transform.stream.StreamSource |
toStreamSourceFromDOM(javax.xml.transform.dom.DOMSource source)
To stream source from DOM. |
javax.xml.transform.stream.StreamSource |
toStreamSourceFromSAX(javax.xml.transform.sax.SAXSource source)
To stream source from SAX. |
java.lang.String |
toString(org.w3c.dom.Node node)
Converts the given input Node into text. |
java.lang.String |
toString(javax.xml.transform.Source source)
Converts the given input Source into text. |
javax.xml.stream.XMLStreamReader |
toXMLStreamReader(javax.xml.transform.Source source)
To XML stream reader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SourceTransformer()
public SourceTransformer(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory)
documentBuilderFactory
- the DocumentBuilderFactory
Method Detail |
---|
public void toResult(javax.xml.transform.Source source, javax.xml.transform.Result result) throws javax.xml.transform.TransformerException
source
- the source to transformresult
- the result of the transformation
javax.xml.transform.TransformerException
- if some transformation error occurspublic java.lang.String toString(javax.xml.transform.Source source) throws javax.xml.transform.TransformerException
source
- the source
javax.xml.transform.TransformerException
- if some transformation error occurspublic java.lang.String toString(org.w3c.dom.Node node) throws javax.xml.transform.TransformerException
node
- the Dom node
Node
as a String
javax.xml.transform.TransformerException
- if some transformation error occurspublic java.lang.String contentToString(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
message
- The message
org.xml.sax.SAXException
- If some problem occurs
java.io.IOException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
javax.jbi.messaging.MessagingException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.dom.DOMSource toDOMSource(javax.xml.transform.Source source) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException, javax.xml.transform.TransformerException
DOMSource
or returns null if
the conversion is not supported (making it easy to derive from this class
to add new kinds of conversion).
source
- The source to transform
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.Source toDOMSource(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
message
- The NormalizedMessage
javax.jbi.messaging.MessagingException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurspublic javax.xml.transform.sax.SAXSource toSAXSource(javax.xml.transform.Source source) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.transform.TransformerException
SAXSource
or returns null if
the conversion is not supported (making it easy to derive from this class
to add new kinds of conversion).
source
- The source to transform
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.stream.StreamSource toStreamSource(javax.xml.transform.Source source) throws javax.xml.transform.TransformerException
source
- The Source
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.stream.StreamSource toStreamSourceFromSAX(javax.xml.transform.sax.SAXSource source) throws javax.xml.transform.TransformerException
source
- The Source
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.stream.StreamSource toStreamSourceFromDOM(javax.xml.transform.dom.DOMSource source) throws javax.xml.transform.TransformerException
source
- The DOMSource
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.sax.SAXSource toSAXSourceFromStream(javax.xml.transform.stream.StreamSource source)
source
- The Source
public java.io.Reader toReaderFromSource(javax.xml.transform.Source src) throws javax.xml.transform.TransformerException
src
- The source
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.dom.DOMSource toDOMSourceFromStream(javax.xml.transform.stream.StreamSource source) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
source
- The stream source
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurspublic javax.xml.transform.sax.SAXSource toSAXSourceFromDOM(javax.xml.transform.dom.DOMSource source) throws javax.xml.transform.TransformerException
source
- The DOMSource
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.transform.dom.DOMSource toDOMSourceFromSAX(javax.xml.transform.sax.SAXSource source) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, javax.xml.transform.TransformerException
source
- The source
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic org.w3c.dom.Node toDOMNodeFromSAX(javax.xml.transform.sax.SAXSource source) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException, javax.xml.transform.TransformerException
source
- The Source
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic org.w3c.dom.Node toDOMNode(javax.xml.transform.Source source) throws javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
source
- The source
org.xml.sax.SAXException
- If some problem occurs
java.io.IOException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic org.w3c.dom.Node toDOMNode(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
message
- the normalized message
org.xml.sax.SAXException
- If some problem occurs
java.io.IOException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
javax.jbi.messaging.MessagingException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic org.w3c.dom.Element toDOMElement(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
message
-
javax.jbi.messaging.MessagingException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Element toDOMElement(javax.xml.transform.Source source) throws javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
source
- The Source
javax.xml.transform.TransformerException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurspublic org.w3c.dom.Element toDOMElement(org.w3c.dom.Node node) throws javax.xml.transform.TransformerException
node
- The DOM node
javax.xml.transform.TransformerException
- If some problem occurspublic org.w3c.dom.Document toDOMDocument(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
message
- The NormalizedMessage
javax.jbi.messaging.MessagingException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurspublic org.w3c.dom.Document toDOMDocument(javax.xml.transform.Source source) throws javax.xml.transform.TransformerException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
source
- The Source
javax.xml.transform.TransformerException
- If some problem occurs
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
java.io.IOException
- If some problem occurs
org.xml.sax.SAXException
- If some problem occurspublic org.w3c.dom.Document toDOMDocument(org.w3c.dom.Node node) throws javax.xml.parsers.ParserConfigurationException, javax.xml.transform.TransformerException
node
- The Node
javax.xml.parsers.ParserConfigurationException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occurspublic javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()
public void setDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory)
documentBuilderFactory
- the new document builder factorypublic javax.xml.parsers.DocumentBuilderFactory createDocumentBuilderFactory()
public javax.xml.parsers.DocumentBuilder createDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
- If some problem occurspublic org.w3c.dom.Document createDocument() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
- If some problem occurspublic javax.xml.transform.TransformerFactory getTransformerFactory()
public void setTransformerFactory(javax.xml.transform.TransformerFactory transformerFactory)
transformerFactory
- the new transformer factorypublic javax.xml.transform.Transformer createTransfomer() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- If some problem occurspublic javax.xml.transform.TransformerFactory createTransformerFactory()
public javax.xml.stream.XMLStreamReader toXMLStreamReader(javax.xml.transform.Source source) throws javax.xml.stream.XMLStreamException, javax.xml.transform.TransformerException
source
- The Source
javax.xml.stream.XMLStreamException
- If some problem occurs
javax.xml.transform.TransformerException
- If some problem occursprotected javax.xml.stream.XMLInputFactory createInputFactory()
public javax.xml.stream.XMLInputFactory getInputFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |