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 PayloadtoPayload(ByteArrayOutputStream bout)Constructs a Payload around the given ByteArrayOutputStream.static ExtendedPayloadtoPayload(ByteArrayOutputStream bout, PayloadMetadata metadata)Constructs a ExtendedPayload around the given ByteArrayOutputStream.static PayloadtoPayload(InputStream input)Constructs a Payload around the given InputStream.static ExtendedPayloadtoPayload(InputStream input, PayloadMetadata metadata)Constructs a ExtendedPayload around the given InputStream and PayloadMetadata.static PayloadtoPayload(String input)Constructs a Payload around the given String, to be encoded using the Atom default Charset.static ExtendedPayloadtoPayload(String input, PayloadMetadata metadata)Constructs a ExtendedPayload around the given String, to be encoded using the Atom default Charset.static PayloadtoPayload(String input, Charset charset)Constructs a Payload around the given String, to be encoded using the given Charset.static ExtendedPayloadtoPayload(String input, Charset charset, PayloadMetadata metadata)Constructs a ExtendedPayload around the given String, to be encoded using the given Charset.static PayloadtoPayload(javax.xml.bind.JAXBContext jaxbContext, Object obj)Constructs a Payload around the given JAXB object.static ExtendedPayloadtoPayload(javax.xml.bind.JAXBContext jaxbContext, Object obj, PayloadMetadata metadata)Constructs a ExtendedPayload around the given JAXB object.static PayloadtoPayload(Source source)Constructs a Payload around the given xml Source.static ExtendedPayloadtoPayload(Source source, PayloadMetadata metadata)Constructs a ExtendedPayload around the given xml Source.static PayloadtoPayload(Node node)Constructs a Payload around the given xml Node.static ExtendedPayloadtoPayload(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
-
-