Class JaxbFactory
java.lang.Object
com.sportradar.livedata.sdk.proto.common.JaxbFactory
- All Implemented Interfaces:
JaxbBuilder
Represents a factory used to create jaxb based
Marshaller and Unmarshaller instances.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJaxbFactory(jakarta.xml.bind.JAXBContext context) Initializes a new instance of theJaxbFactoryclass.JaxbFactory(jakarta.xml.bind.JAXBContext context, SchemaFactory schemaFactory, Source schemaSource) Initializes a new instance of theJaxbFactoryclass. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.xml.bind.MarshallerCreates and returns aMarshallerimplementation.jakarta.xml.bind.UnmarshallerCreates and returns aUnmarshallerimplementation.Gets the configured character encoding for the builder.
-
Field Details
-
ENCODING
- See Also:
-
-
Constructor Details
-
JaxbFactory
@Inject public JaxbFactory(jakarta.xml.bind.JAXBContext context) Initializes a new instance of theJaxbFactoryclass.- Parameters:
context- TheJAXBContextused to create marshallers and un-marshallers.- Throws:
IllegalArgumentException- Thecontextis a null reference.
-
JaxbFactory
public JaxbFactory(jakarta.xml.bind.JAXBContext context, SchemaFactory schemaFactory, Source schemaSource) Initializes a new instance of theJaxbFactoryclass.- Parameters:
context- TheJAXBContextused to create marshallers and un-marshallers.schemaFactory- TheSchemaFactoryused to createSchemawhich is used to validate the data before un-marshalling it or a null reference in no validation is required.schemaSource- TheSourcecontaining schema definition. This argument is only required when theschemaFactoryis not a null reference. Otherwise this argument is ignored.- Throws:
IllegalArgumentException- Thecontextis a null reference orschemaFactoryis a null reference orschemaSourceis a null reference.
-
-
Method Details
-
buildMarshaller
Creates and returns aMarshallerimplementation. Note that each time this method is called new instance of the marshaller is created.- Specified by:
buildMarshallerin interfaceJaxbBuilder- Returns:
- The created
Marshallerinstance. - Throws:
ProtocolException- wrapped JAXBException.
-
buildUnmarshaller
Creates and returns aUnmarshallerimplementation. Note that each time this method is called new instance of the un-marshaller is created.- Specified by:
buildUnmarshallerin interfaceJaxbBuilder- Returns:
- The created
Unmarshallerinstance. - Throws:
ProtocolException- wrapped JAXBException.
-
getEncoding
Gets the configured character encoding for the builder.- Specified by:
getEncodingin interfaceJaxbBuilder- Returns:
- - a string, i.e. UTF-8
-