Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.api

public abstract Class Bridge<T>

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.runtime.InternalBridge
Imports
com.sun.istack.NotNull, .Nullable, org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl, jakarta.xml.bind.JAXBException, .Marshaller, .Unmarshaller, jakarta.xml.bind.attachment.AttachmentMarshaller, .AttachmentUnmarshaller, org.w3c.dom.Node, org.xml.sax.ContentHandler, javax.xml.namespace.NamespaceContext, javax.xml.stream.XMLStreamReader, .XMLStreamWriter, javax.xml.transform.Result, .Source, java.io.InputStream, .OutputStream

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.

Author
Kohsuke Kawaguchi
Since
JAXB 2.0 EA1

Field Summary

Modifier and TypeField and Description
protected final JAXBContextImpl

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private T
public JAXBRIContext
getContext()

Gets the JAXBRIContext to which this object belongs.

public abstract TypeReference
getTypeReference()

Gets the TypeReference from which this bridge was created.

public final void
marshal(T object, XMLStreamWriter output)

public final void
public abstract void
marshal(Marshaller m, T object, XMLStreamWriter output)

public void
marshal(T object, OutputStream output, NamespaceContext
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.
nsContext
)

Marshals the specified type object with the implicit element name associated with this instance of .

public void
marshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am)

public abstract void
marshal(Marshaller m, T object, OutputStream output, NamespaceContext nsContext)

public final void
marshal(T object, Node output)

public abstract void
marshal(Marshaller m, T object, Node output)

public final void
marshal(T object, ContentHandler contentHandler)

public final void
marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am)

public abstract void
marshal(Marshaller m, T object, ContentHandler contentHandler)

public final void
marshal(T object, Result result)

public abstract void
marshal(Marshaller m, T object, Result result)

public final T

Returns:

never null.
unmarshal
(XMLStreamReader
the parser must be pointing at a start tag that encloses the XML type that this is instanciated for.
in
)

Unmarshals the specified type object.

public final T
public abstract T
public final T

Returns:

never null.
unmarshal
(Source
the parser must be pointing at a start tag that encloses the XML type that this is instanciated for.
in
)

Unmarshals the specified type object.

public final T
public abstract T
public final T

Returns:

never null.
unmarshal
(InputStream
the parser must be pointing at a start tag that encloses the XML type that this is instanciated for.
in
)

Unmarshals the specified type object.

public abstract T
public final T

Returns:

never null.
unmarshal
(Node
Node to be unmarshalled.
n
)

Unmarshals the specified type object.

public final T
public abstract T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
protected final JAXBContextImpl context

Constructor Detail

Bridgeback to summary
protected Bridge(JAXBContextImpl context)

Method Detail

exitback to summary
private T exit(T r, Unmarshaller u)
getContextback to summary
public JAXBRIContext getContext()

Gets the JAXBRIContext to which this object belongs.

Annotations
@NotNull
Since
2.1
getTypeReferenceback to summary
public abstract TypeReference getTypeReference()

Gets the TypeReference from which this bridge was created.

marshalback to summary
public final void marshal(T object, XMLStreamWriter output) throws JAXBException
Exceptions
JAXBException:
if there was an error while marshalling.
Since
2.0 EA1
marshalback to summary
public final void marshal(T object, XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException
marshalback to summary
public abstract void marshal(Marshaller m, T object, XMLStreamWriter output) throws JAXBException
marshalback to summary
public void marshal(T object, OutputStream output, NamespaceContext nsContext) throws JAXBException

Marshals the specified type object with the implicit element name associated with this instance of .

Parameters
nsContext:NamespaceContext

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.

Exceptions
JAXBException:
if there was an error while marshalling.
Since
2.0 EA1
marshalback to summary
public void marshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException
Since
2.0.2
marshalback to summary
public abstract void marshal(Marshaller m, T object, OutputStream output, NamespaceContext nsContext) throws JAXBException
marshalback to summary
public final void marshal(T object, Node output) throws JAXBException
marshalback to summary
public abstract void marshal(Marshaller m, T object, Node output) throws JAXBException
marshalback to summary
public final void marshal(T object, ContentHandler contentHandler) throws JAXBException
Since
2.0 EA4
marshalback to summary
public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException
Since
2.0.2
marshalback to summary
public abstract void marshal(Marshaller m, T object, ContentHandler contentHandler) throws JAXBException
marshalback to summary
public final void marshal(T object, Result result) throws JAXBException
Since
2.0 EA4
marshalback to summary
public abstract void marshal(Marshaller m, T object, Result result) throws JAXBException
unmarshalback to summary
public final T unmarshal(XMLStreamReader in) throws JAXBException

Unmarshals the specified type object.

Parameters
in:XMLStreamReader

the parser must be pointing at a start tag that encloses the XML type that this is instanciated for.

Returns:T

never null.

Annotations
@NotNull
Exceptions
JAXBException:
if there was an error while unmarshalling.
Since
2.0 EA1
unmarshalback to summary
public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) throws JAXBException
Annotations
@NotNull
Since
2.0.3
unmarshalback to summary
public abstract T unmarshal(Unmarshaller u, XMLStreamReader in) throws JAXBException
Annotations
@NotNull
unmarshalback to summary
public final T unmarshal(Source in) throws JAXBException

Unmarshals the specified type object.

Parameters
in:Source

the parser must be pointing at a start tag that encloses the XML type that this is instanciated for.

Returns:T

never null.

Annotations
@NotNull
Exceptions
JAXBException:
if there was an error while unmarshalling.
Since
2.0 EA1
unmarshalback to summary
public final T unmarshal(Source in, AttachmentUnmarshaller au) throws JAXBException
Annotations
@NotNull
Since
2.0.3
unmarshalback to summary
public abstract T unmarshal(Unmarshaller u, Source in) throws JAXBException
Annotations
@NotNull
unmarshalback to summary
public final T unmarshal(InputStream in) throws JAXBException

Unmarshals the specified type object.

Parameters
in:InputStream

the parser must be pointing at a start tag that encloses the XML type that this is instanciated for.

Returns:T

never null.

Annotations
@NotNull
Exceptions
JAXBException:
if there was an error while unmarshalling.
Since
2.0 EA1
unmarshalback to summary
public abstract T unmarshal(Unmarshaller u, InputStream in) throws JAXBException
Annotations
@NotNull
unmarshalback to summary
public final T unmarshal(Node n) throws JAXBException

Unmarshals the specified type object.

Parameters
n:Node

Node to be unmarshalled.

Returns:T

never null.

Annotations
@NotNull
Exceptions
JAXBException:
if there was an error while unmarshalling.
Since
2.0 FCS
unmarshalback to summary
public final T unmarshal(Node n, AttachmentUnmarshaller au) throws JAXBException
Annotations
@NotNull
Since
2.0.3
unmarshalback to summary
public abstract T unmarshal(Unmarshaller context, Node n) throws JAXBException
Annotations
@NotNull