Class PayloadUtil
- java.lang.Object
-
- com.boomi.connector.util.PayloadUtil
-
public class PayloadUtil extends Object
This class has been moved from com.boomi.connector.api to com.boomi.connector.util.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Payload
toPayload(ByteArrayOutputStream bout)
Constructs a Payload around the given ByteArrayOutputStream.static ExtendedPayload
toPayload(ByteArrayOutputStream bout, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given ByteArrayOutputStream.static Payload
toPayload(InputStream input)
Constructs a Payload around the given InputStream.static ExtendedPayload
toPayload(InputStream input, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given InputStream and PayloadMetadata.static Payload
toPayload(String input)
Constructs a Payload around the given String, to be encoded using the Atom default Charset.static ExtendedPayload
toPayload(String input, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given String, to be encoded using the Atom default Charset.static Payload
toPayload(String input, Charset charset)
Constructs a Payload around the given String, to be encoded using the given Charset.static ExtendedPayload
toPayload(String input, Charset charset, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given String, to be encoded using the given Charset.static Payload
toPayload(javax.xml.bind.JAXBContext jaxbContext, Object obj)
Constructs a Payload around the given JAXB object.static ExtendedPayload
toPayload(javax.xml.bind.JAXBContext jaxbContext, Object obj, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given JAXB object.static Payload
toPayload(Source source)
Constructs a Payload around the given xml Source.static ExtendedPayload
toPayload(Source source, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given xml Source.static Payload
toPayload(Node node)
Constructs a Payload around the given xml Node.static ExtendedPayload
toPayload(Node node, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given xml Node.
-
-
-
Method Detail
-
toPayload
public static Payload toPayload(InputStream input)
Constructs a Payload around the given InputStream.- Parameters:
input
- input stream to be returned by the new Payload
-
toPayload
public static ExtendedPayload toPayload(InputStream input, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given InputStream and PayloadMetadata.- Parameters:
input
- input stream to be returned by the new ExtendedPayloadmetadata
- PayloadMetadata to be used by the ExtendedPayload
-
toPayload
public static Payload toPayload(javax.xml.bind.JAXBContext jaxbContext, Object obj)
Constructs a Payload around the given JAXB object.- Parameters:
jaxbContext
- context which should be used to marshal the given objectobj
- JAXB object to be written by the new payload
-
toPayload
public static ExtendedPayload toPayload(javax.xml.bind.JAXBContext jaxbContext, Object obj, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given JAXB object.- Parameters:
jaxbContext
- context which should be used to marshal the given objectobj
- JAXB object to be written by the new ExtendedPayloadmetadata
- PayloadMetadata to be used by the ExtendedPayload
-
toPayload
public static Payload toPayload(Node node)
Constructs a Payload around the given xml Node.- Parameters:
node
- xml to be written by the new payload
-
toPayload
public static ExtendedPayload toPayload(Node node, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given xml Node.- Parameters:
node
- xml to be written by the new ExtendedPayloadmetadata
- PayloadMetadata to be used by the ExtendedPayload
-
toPayload
public static Payload toPayload(Source source)
Constructs a Payload around the given xml Source.- Parameters:
source
- xml to be written by the new payload
-
toPayload
public static ExtendedPayload toPayload(Source source, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given xml Source.- Parameters:
source
- xml to be written by the new ExtendedPayloadmetadata
- PayloadMetadata to be used by the ExtendedPayload
-
toPayload
public static Payload toPayload(String input)
Constructs a Payload around the given String, to be encoded using the Atom default Charset.Warning, the use of String output is generally discouraged as it can cause memory issues. Please avoid if at all possible.
- Parameters:
input
- input String to be encoded in the new Payload
-
toPayload
public static ExtendedPayload toPayload(String input, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given String, to be encoded using the Atom default Charset.Warning, the use of String output is generally discouraged as it can cause memory issues. Please avoid if at all possible.
- Parameters:
input
- input String to be encoded in the new ExtendedPayloadmetadata
- PayloadMetadata to be used by the ExtendedPayload
-
toPayload
public static Payload toPayload(String input, Charset charset)
Constructs a Payload around the given String, to be encoded using the given Charset.Warning, the use of String output is generally discouraged as it can cause memory issues. Please avoid if at all possible.
- Parameters:
input
- input String to be encoded in the new Payloadcharset
- the charset to use when encoding the String, may benull
, in which case the Atom default is used
-
toPayload
public static ExtendedPayload toPayload(String input, Charset charset, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given String, to be encoded using the given Charset.Warning, the use of String output is generally discouraged as it can cause memory issues. Please avoid if at all possible.
- Parameters:
input
- input String to be encoded in the new ExtendedPayloadcharset
- the charset to use when encoding the String, may benull
, in which case the Atom default is usedmetadata
- PayloadMetadata to be used by the ExtendedPayload
-
toPayload
public static Payload toPayload(ByteArrayOutputStream bout)
Constructs a Payload around the given ByteArrayOutputStream.Warning, the use of ByteArrayOutputStream is generally discouraged as it can cause memory issues. Please avoid if at all possible.
- Parameters:
bout
- output stream containing the data to be written
-
toPayload
public static ExtendedPayload toPayload(ByteArrayOutputStream bout, PayloadMetadata metadata)
Constructs a ExtendedPayload around the given ByteArrayOutputStream.Warning, the use of ByteArrayOutputStream is generally discouraged as it can cause memory issues. Please avoid if at all possible.
- Parameters:
bout
- output stream containing the data to be writtenmetadata
- PayloadMetadata to be used by the ExtendedPayload
-
-