Class EitherXmlAdapter
java.lang.Object
jakarta.xml.bind.annotation.adapters.XmlAdapter<EitherXmlAdapter.EitherElement, Either<?,?>>
dmx.fun.jakarta.jaxb.EitherXmlAdapter
@NullMarked
public final class EitherXmlAdapter
extends jakarta.xml.bind.annotation.adapters.XmlAdapter<EitherXmlAdapter.EitherElement, Either<?,?>>
JAXB
XmlAdapter for Either.
XML shapes:
<!-- Either.right("yes") -->
<field><right>yes</right></field>
<!-- Either.left("no") -->
<field><left>no</left></field>
Usage:
@XmlJavaTypeAdapter(EitherXmlAdapter.class)
Either<String, String> decision;
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable EitherXmlAdapter.EitherElementEither<?, ?> unmarshal(@Nullable EitherXmlAdapter.EitherElement v)
-
Constructor Details
-
EitherXmlAdapter
public EitherXmlAdapter()Creates a new instance.
-
-
Method Details
-
unmarshal
- Specified by:
unmarshalin classjakarta.xml.bind.annotation.adapters.XmlAdapter<EitherXmlAdapter.EitherElement, Either<?,?>> - Throws:
Exception
-
marshal
- Specified by:
marshalin classjakarta.xml.bind.annotation.adapters.XmlAdapter<EitherXmlAdapter.EitherElement, Either<?,?>> - Throws:
Exception
-