T - type of JAXB annotated objects that will be serialized.public class JAXBCoder<T> extends AtomicCoder<T>
Class of the JAXB annotated object.Coder.Context, Coder.NonDeterministicException| Modifier and Type | Method and Description |
|---|---|
com.google.cloud.dataflow.sdk.util.CloudObject |
asCloudObject()
Returns the
CloudObject that represents this Coder. |
T |
decode(InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(T value,
OutputStream outStream,
Coder.Context context)
Encodes the given value of type
T onto the given output stream
in the given context. |
Class<T> |
getJAXBClass() |
static <T> JAXBCoder<T> |
of(Class<T> jaxbClass)
Create a coder for a given type of JAXB annotated objects.
|
static <T> JAXBCoder<T> |
of(String jaxbClassName)
Constructor for JSON deserialization only.
|
getCoderArguments, getInstanceComponentsverifyDeterministicconsistentWithEquals, equals, getComponents, getEncodedElementByteSize, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static <T> JAXBCoder<T> of(Class<T> jaxbClass)
jaxbClass - the Class of the JAXB annotated objects.public void encode(T value, OutputStream outStream, Coder.Context context) throws CoderException, IOException
CoderT onto the given output stream
in the given context.CoderException - if the value could not be encoded for some reasonIOException - if writing to the OutputStream fails
for some reasonpublic T decode(InputStream inStream, Coder.Context context) throws CoderException, IOException
CoderT from the given input stream in
the given context. Returns the decoded value.CoderException - if the value could not be decoded for some reasonIOException - if reading from the InputStream fails
for some reasonpublic static <T> JAXBCoder<T> of(String jaxbClassName)
public com.google.cloud.dataflow.sdk.util.CloudObject asCloudObject()
CoderCloudObject that represents this Coder.asCloudObject in interface Coder<T>asCloudObject in class StandardCoder<T>