|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.imolinfo.jbi4corba.jbi.processor.transform.SourceTransformer
public class SourceTransformer
Taken from servicemix-core SourceTransformer
and partially
from StAXSoureTransformer
class.
Constructor Summary | |
---|---|
SourceTransformer()
Instantiates a new source transformer. |
|
SourceTransformer(DocumentBuilderFactory documentBuilderFactory)
Instantiates a new source transformer. |
Method Summary | |
---|---|
String |
contentToString(javax.jbi.messaging.NormalizedMessage message)
Converts the content of the given message to a String. |
Document |
createDocument()
Creates the document. |
DocumentBuilder |
createDocumentBuilder()
Creates the document builder. |
DocumentBuilderFactory |
createDocumentBuilderFactory()
Creates the document builder factory. |
protected javax.xml.stream.XMLInputFactory |
createInputFactory()
Creates the input factory. |
Transformer |
createTransfomer()
Creates the transfomer. |
TransformerFactory |
createTransformerFactory()
Creates the transformer factory. |
DocumentBuilderFactory |
getDocumentBuilderFactory()
Gets the document builder factory. |
javax.xml.stream.XMLInputFactory |
getInputFactory()
Gets the input factory. |
TransformerFactory |
getTransformerFactory()
Gets the transformer factory. |
void |
setDocumentBuilderFactory(DocumentBuilderFactory documentBuilderFactory)
Sets the document builder factory. |
void |
setTransformerFactory(TransformerFactory transformerFactory)
Sets the transformer factory. |
Document |
toDOMDocument(Node node)
Create a DOM document from the given Node. |
Document |
toDOMDocument(javax.jbi.messaging.NormalizedMessage message)
Create a DOM document from the given normalized message. |
Document |
toDOMDocument(Source source)
Create a DOM document from the given source. |
Element |
toDOMElement(Node node)
Create a DOM element from the DOM node. |
Element |
toDOMElement(javax.jbi.messaging.NormalizedMessage message)
Create a DOM element from the normalized message. |
Element |
toDOMElement(Source source)
Create a DOM element from the given source. |
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. |
Node |
toDOMNode(Source source)
Converts the given TRaX Source into a W3C DOM node. |
Node |
toDOMNodeFromSAX(SAXSource source)
To DOM node from SAX. |
Source |
toDOMSource(javax.jbi.messaging.NormalizedMessage message)
To DOM source. |
DOMSource |
toDOMSource(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). |
DOMSource |
toDOMSourceFromSAX(SAXSource source)
To DOM source from SAX. |
DOMSource |
toDOMSourceFromStream(StreamSource source)
To DOM source from stream. |
Reader |
toReaderFromSource(Source src)
To reader from source. |
void |
toResult(Source source,
Result result)
Converts the given input Source into the required result. |
SAXSource |
toSAXSource(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). |
SAXSource |
toSAXSourceFromDOM(DOMSource source)
To SAX source from DOM. |
SAXSource |
toSAXSourceFromStream(StreamSource source)
To SAX source from stream. |
StreamSource |
toStreamSource(Source source)
To stream source. |
StreamSource |
toStreamSourceFromDOM(DOMSource source)
To stream source from DOM. |
StreamSource |
toStreamSourceFromSAX(SAXSource source)
To stream source from SAX. |
String |
toString(Node node)
Converts the given input Node into text. |
String |
toString(Source source)
Converts the given input Source into text. |
javax.xml.stream.XMLStreamReader |
toXMLStreamReader(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(DocumentBuilderFactory documentBuilderFactory)
documentBuilderFactory
- the DocumentBuilderFactory
Method Detail |
---|
public void toResult(Source source, Result result) throws TransformerException
source
- the source to transformresult
- the result of the transformation
TransformerException
- if some transformation error occurspublic String toString(Source source) throws TransformerException
source
- the source
TransformerException
- if some transformation error occurspublic String toString(Node node) throws TransformerException
node
- the Dom node
Node
as a String
TransformerException
- if some transformation error occurspublic String contentToString(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, TransformerException, ParserConfigurationException, IOException, SAXException
message
- The message
SAXException
- If some problem occurs
IOException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
javax.jbi.messaging.MessagingException
- If some problem occurs
TransformerException
- If some problem occurspublic DOMSource toDOMSource(Source source) throws ParserConfigurationException, IOException, SAXException, 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
ParserConfigurationException
- If some problem occurs
IOException
- If some problem occurs
SAXException
- If some problem occurs
TransformerException
- If some problem occurspublic Source toDOMSource(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, TransformerException, ParserConfigurationException, IOException, SAXException
message
- The NormalizedMessage
javax.jbi.messaging.MessagingException
- If some problem occurs
TransformerException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
IOException
- If some problem occurs
SAXException
- If some problem occurspublic SAXSource toSAXSource(Source source) throws IOException, SAXException, 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
IOException
- If some problem occurs
SAXException
- If some problem occurs
TransformerException
- If some problem occurspublic StreamSource toStreamSource(Source source) throws TransformerException
source
- The Source
TransformerException
- If some problem occurspublic StreamSource toStreamSourceFromSAX(SAXSource source) throws TransformerException
source
- The Source
TransformerException
- If some problem occurspublic StreamSource toStreamSourceFromDOM(DOMSource source) throws TransformerException
source
- The DOMSource
TransformerException
- If some problem occurspublic SAXSource toSAXSourceFromStream(StreamSource source)
source
- The Source
public Reader toReaderFromSource(Source src) throws TransformerException
src
- The source
TransformerException
- If some problem occurspublic DOMSource toDOMSourceFromStream(StreamSource source) throws ParserConfigurationException, IOException, SAXException
source
- The stream source
ParserConfigurationException
- If some problem occurs
IOException
- If some problem occurs
SAXException
- If some problem occurspublic SAXSource toSAXSourceFromDOM(DOMSource source) throws TransformerException
source
- The DOMSource
TransformerException
- If some problem occurspublic DOMSource toDOMSourceFromSAX(SAXSource source) throws IOException, SAXException, ParserConfigurationException, TransformerException
source
- The source
IOException
- If some problem occurs
SAXException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
TransformerException
- If some problem occurspublic Node toDOMNodeFromSAX(SAXSource source) throws ParserConfigurationException, IOException, SAXException, TransformerException
source
- The Source
ParserConfigurationException
- If some problem occurs
IOException
- If some problem occurs
SAXException
- If some problem occurs
TransformerException
- If some problem occurspublic Node toDOMNode(Source source) throws TransformerException, ParserConfigurationException, IOException, SAXException
source
- The source
SAXException
- If some problem occurs
IOException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
TransformerException
- If some problem occurspublic Node toDOMNode(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, TransformerException, ParserConfigurationException, IOException, SAXException
message
- the normalized message
SAXException
- If some problem occurs
IOException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
javax.jbi.messaging.MessagingException
- If some problem occurs
TransformerException
- If some problem occurspublic Element toDOMElement(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, TransformerException, ParserConfigurationException, IOException, SAXException
message
-
javax.jbi.messaging.MessagingException
- If some problem occurs
TransformerException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
IOException
SAXException
public Element toDOMElement(Source source) throws TransformerException, ParserConfigurationException, IOException, SAXException
source
- The Source
TransformerException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
IOException
- If some problem occurs
SAXException
- If some problem occurspublic Element toDOMElement(Node node) throws TransformerException
node
- The DOM node
TransformerException
- If some problem occurspublic Document toDOMDocument(javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException, TransformerException, ParserConfigurationException, IOException, SAXException
message
- The NormalizedMessage
javax.jbi.messaging.MessagingException
- If some problem occurs
TransformerException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
IOException
- If some problem occurs
SAXException
- If some problem occurspublic Document toDOMDocument(Source source) throws TransformerException, ParserConfigurationException, IOException, SAXException
source
- The Source
TransformerException
- If some problem occurs
ParserConfigurationException
- If some problem occurs
IOException
- If some problem occurs
SAXException
- If some problem occurspublic Document toDOMDocument(Node node) throws ParserConfigurationException, TransformerException
node
- The Node
ParserConfigurationException
- If some problem occurs
TransformerException
- If some problem occurspublic DocumentBuilderFactory getDocumentBuilderFactory()
public void setDocumentBuilderFactory(DocumentBuilderFactory documentBuilderFactory)
documentBuilderFactory
- the new document builder factorypublic DocumentBuilderFactory createDocumentBuilderFactory()
public DocumentBuilder createDocumentBuilder() throws ParserConfigurationException
ParserConfigurationException
- If some problem occurspublic Document createDocument() throws ParserConfigurationException
ParserConfigurationException
- If some problem occurspublic TransformerFactory getTransformerFactory()
public void setTransformerFactory(TransformerFactory transformerFactory)
transformerFactory
- the new transformer factorypublic Transformer createTransfomer() throws TransformerConfigurationException
TransformerConfigurationException
- If some problem occurspublic TransformerFactory createTransformerFactory()
public javax.xml.stream.XMLStreamReader toXMLStreamReader(Source source) throws javax.xml.stream.XMLStreamException, TransformerException
source
- The Source
javax.xml.stream.XMLStreamException
- If some problem occurs
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 |