net.javacrumbs.smock.common
Class XmlUtil

java.lang.Object
  extended by net.javacrumbs.smock.common.XmlUtil

public class XmlUtil
extends Object

Helper class for work with XML.

Author:
Lukas Krecan

Method Summary
static InputStream getDocumentAsStream(Document document)
          Streams the document as UTF-8 encoded stream.
static Source getEnvelopeSource(org.springframework.ws.WebServiceMessage message)
          Returns source of message envelope
static InputStream getSourceAsStream(Source source)
          Streams the source as UTF-8 encoded stream.
static boolean isSoap(Source source)
          Returns true if the documents root is SOAP envelope.
static Document loadDocument(Source source)
          Loads document from source.
static String serialize(Document document)
          Converts document to String.
static String serialize(Source source)
          Converts Source to String.
static byte[] stringToBytes(String string)
           
static void transform(Source source, Result result)
          Does transofrmation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadDocument

public static Document loadDocument(Source source)
Loads document from source.

Parameters:
source -
Returns:

isSoap

public static boolean isSoap(Source source)
Returns true if the documents root is SOAP envelope.

Parameters:
document -
Returns:

serialize

public static String serialize(Document document)
Converts document to String.

Parameters:
document -
Returns:

getEnvelopeSource

public static Source getEnvelopeSource(org.springframework.ws.WebServiceMessage message)
Returns source of message envelope

Parameters:
message -
Returns:

serialize

public static String serialize(Source source)
Converts Source to String.

Parameters:
source -
Returns:

transform

public static void transform(Source source,
                             Result result)
Does transofrmation.

Parameters:
source -
result -

getDocumentAsStream

public static InputStream getDocumentAsStream(Document document)
Streams the document as UTF-8 encoded stream.

Parameters:
document -
Returns:

getSourceAsStream

public static InputStream getSourceAsStream(Source source)
Streams the source as UTF-8 encoded stream.

Parameters:
document -
Returns:

stringToBytes

public static byte[] stringToBytes(String string)


Copyright © 2011. All Rights Reserved.