Class Bridge<T>

  • Direct Known Subclasses:
    MarshallerBridge

    public abstract class Bridge<T>
    extends Object
    Mini-marshaller/unmarshaller that is specialized for a particular element name and a type.

    Instances of this class is stateless and multi-thread safe. They are reentrant.

    All the marshal operation generates fragments.

    Subject to change without notice.

    Since:
    JAXB 2.0 EA1
    Author:
    Kohsuke Kawaguchi
    • Method Detail

      • marshal

        public final void marshal​(T object,
                                  XMLStreamWriter output)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException - if there was an error while marshalling.
        Since:
        2.0 EA1
      • marshal

        public final void marshal​(T object,
                                  XMLStreamWriter output,
                                  jakarta.xml.bind.attachment.AttachmentMarshaller am)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public final void marshal​(@NotNull
                                  BridgeContext context,
                                  T object,
                                  XMLStreamWriter output)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public abstract void marshal​(@NotNull
                                     jakarta.xml.bind.Marshaller m,
                                     T object,
                                     XMLStreamWriter output)
                              throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public void marshal​(T object,
                            OutputStream output,
                            NamespaceContext nsContext)
                     throws jakarta.xml.bind.JAXBException
        Marshals the specified type object with the implicit element name associated with this instance of Bridge.
        Parameters:
        nsContext - if this marshalling is done to marshal a subelement, this NamespaceContext represents in-scope namespace bindings available for that element. Can be null, in which case JAXB assumes no in-scope namespaces.
        Throws:
        jakarta.xml.bind.JAXBException - if there was an error while marshalling.
        Since:
        2.0 EA1
      • marshal

        public void marshal​(T object,
                            OutputStream output,
                            NamespaceContext nsContext,
                            jakarta.xml.bind.attachment.AttachmentMarshaller am)
                     throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
        Since:
        2.0.2
      • marshal

        public final void marshal​(@NotNull
                                  BridgeContext context,
                                  T object,
                                  OutputStream output,
                                  NamespaceContext nsContext)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public abstract void marshal​(@NotNull
                                     jakarta.xml.bind.Marshaller m,
                                     T object,
                                     OutputStream output,
                                     NamespaceContext nsContext)
                              throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public final void marshal​(T object,
                                  Node output)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public final void marshal​(@NotNull
                                  BridgeContext context,
                                  T object,
                                  Node output)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public abstract void marshal​(@NotNull
                                     jakarta.xml.bind.Marshaller m,
                                     T object,
                                     Node output)
                              throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public final void marshal​(T object,
                                  ContentHandler contentHandler)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
        Since:
        2.0 EA4
      • marshal

        public final void marshal​(T object,
                                  ContentHandler contentHandler,
                                  jakarta.xml.bind.attachment.AttachmentMarshaller am)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
        Since:
        2.0.2
      • marshal

        public final void marshal​(@NotNull
                                  BridgeContext context,
                                  T object,
                                  ContentHandler contentHandler)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public abstract void marshal​(@NotNull
                                     jakarta.xml.bind.Marshaller m,
                                     T object,
                                     ContentHandler contentHandler)
                              throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public final void marshal​(T object,
                                  Result result)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
        Since:
        2.0 EA4
      • marshal

        public final void marshal​(@NotNull
                                  BridgeContext context,
                                  T object,
                                  Result result)
                           throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • marshal

        public abstract void marshal​(@NotNull
                                     jakarta.xml.bind.Marshaller m,
                                     T object,
                                     Result result)
                              throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 XMLStreamReader in)
                          throws jakarta.xml.bind.JAXBException
        Unmarshals the specified type object.
        Parameters:
        in - the parser must be pointing at a start tag that encloses the XML type that this Bridge is instanciated for.
        Returns:
        never null.
        Throws:
        jakarta.xml.bind.JAXBException - if there was an error while unmarshalling.
        Since:
        2.0 EA1
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 XMLStreamReader in,
                                 @Nullable
                                 jakarta.xml.bind.attachment.AttachmentUnmarshaller au)
                          throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
        Since:
        2.0.3
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 BridgeContext context,
                                 @NotNull
                                 XMLStreamReader in)
                          throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public abstract T unmarshal​(@NotNull
                                    jakarta.xml.bind.Unmarshaller u,
                                    @NotNull
                                    XMLStreamReader in)
                             throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 Source in)
                          throws jakarta.xml.bind.JAXBException
        Unmarshals the specified type object.
        Parameters:
        in - the parser must be pointing at a start tag that encloses the XML type that this Bridge is instanciated for.
        Returns:
        never null.
        Throws:
        jakarta.xml.bind.JAXBException - if there was an error while unmarshalling.
        Since:
        2.0 EA1
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 Source in,
                                 @Nullable
                                 jakarta.xml.bind.attachment.AttachmentUnmarshaller au)
                          throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
        Since:
        2.0.3
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 BridgeContext context,
                                 @NotNull
                                 Source in)
                          throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public abstract T unmarshal​(@NotNull
                                    jakarta.xml.bind.Unmarshaller u,
                                    @NotNull
                                    Source in)
                             throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 InputStream in)
                          throws jakarta.xml.bind.JAXBException
        Unmarshals the specified type object.
        Parameters:
        in - the parser must be pointing at a start tag that encloses the XML type that this Bridge is instanciated for.
        Returns:
        never null.
        Throws:
        jakarta.xml.bind.JAXBException - if there was an error while unmarshalling.
        Since:
        2.0 EA1
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 BridgeContext context,
                                 @NotNull
                                 InputStream in)
                          throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public abstract T unmarshal​(@NotNull
                                    jakarta.xml.bind.Unmarshaller u,
                                    @NotNull
                                    InputStream in)
                             throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 Node n)
                          throws jakarta.xml.bind.JAXBException
        Unmarshals the specified type object.
        Parameters:
        n - Node to be unmarshalled.
        Returns:
        never null.
        Throws:
        jakarta.xml.bind.JAXBException - if there was an error while unmarshalling.
        Since:
        2.0 FCS
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 Node n,
                                 @Nullable
                                 jakarta.xml.bind.attachment.AttachmentUnmarshaller au)
                          throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
        Since:
        2.0.3
      • unmarshal

        @NotNull
        public final T unmarshal​(@NotNull
                                 BridgeContext context,
                                 @NotNull
                                 Node n)
                          throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException
      • unmarshal

        @NotNull
        public abstract T unmarshal​(@NotNull
                                    jakarta.xml.bind.Unmarshaller context,
                                    @NotNull
                                    Node n)
                             throws jakarta.xml.bind.JAXBException
        Throws:
        jakarta.xml.bind.JAXBException