com.sun.xml.bind.api

Class Bridge<T>

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

Field Summary
protected JAXBContextImplcontext
Constructor Summary
protected Bridge(JAXBContextImpl context)
Method Summary
JAXBRIContextgetContext()
Gets the JAXBRIContext to which this object belongs.
abstract TypeReferencegetTypeReference()
Gets the TypeReference from which this bridge was created.
voidmarshal(T object, XMLStreamWriter output)
voidmarshal(T object, XMLStreamWriter output, AttachmentMarshaller am)
voidmarshal(BridgeContext context, T object, XMLStreamWriter output)
abstract voidmarshal(Marshaller m, T object, XMLStreamWriter output)
voidmarshal(T object, OutputStream output, NamespaceContext nsContext)
Marshals the specified type object with the implicit element name associated with this instance of Bridge.
voidmarshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am)
voidmarshal(BridgeContext context, T object, OutputStream output, NamespaceContext nsContext)
abstract voidmarshal(Marshaller m, T object, OutputStream output, NamespaceContext nsContext)
voidmarshal(T object, Node output)
voidmarshal(BridgeContext context, T object, Node output)
abstract voidmarshal(Marshaller m, T object, Node output)
voidmarshal(T object, ContentHandler contentHandler)
voidmarshal(T object, ContentHandler contentHandler, AttachmentMarshaller am)
voidmarshal(BridgeContext context, T object, ContentHandler contentHandler)
abstract voidmarshal(Marshaller m, T object, ContentHandler contentHandler)
voidmarshal(T object, Result result)
voidmarshal(BridgeContext context, T object, Result result)
abstract voidmarshal(Marshaller m, T object, Result result)
Tunmarshal(XMLStreamReader in)
Unmarshals the specified type object.
Tunmarshal(XMLStreamReader in, AttachmentUnmarshaller au)
Tunmarshal(BridgeContext context, XMLStreamReader in)
Tunmarshal(Unmarshaller u, XMLStreamReader in)
Tunmarshal(Source in)
Unmarshals the specified type object.
Tunmarshal(Source in, AttachmentUnmarshaller au)
Tunmarshal(BridgeContext context, Source in)
Tunmarshal(Unmarshaller u, Source in)
Tunmarshal(InputStream in)
Unmarshals the specified type object.
Tunmarshal(BridgeContext context, InputStream in)
Tunmarshal(Unmarshaller u, InputStream in)
Tunmarshal(Node n)
Unmarshals the specified type object.
Tunmarshal(Node n, AttachmentUnmarshaller au)
Tunmarshal(BridgeContext context, Node n)
Tunmarshal(Unmarshaller context, Node n)

Field Detail

context

protected final JAXBContextImpl context

Constructor Detail

Bridge

protected Bridge(JAXBContextImpl context)

Method Detail

getContext

JAXBRIContext getContext()
Gets the JAXBRIContext to which this object belongs.

Since: 2.1

getTypeReference

public abstract TypeReference getTypeReference()
Gets the TypeReference from which this bridge was created.

marshal

public final void marshal(T object, XMLStreamWriter output)

Throws: JAXBException if there was an error while marshalling.

Since: 2.0 EA1

marshal

public final void marshal(T object, XMLStreamWriter output, AttachmentMarshaller am)

marshal

public final void marshal(BridgeContext context, T object, XMLStreamWriter output)

marshal

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

marshal

public void marshal(T object, OutputStream output, NamespaceContext nsContext)
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: JAXBException if there was an error while marshalling.

Since: 2.0 EA1

marshal

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

Since: 2.0.2

marshal

public final void marshal(BridgeContext context, T object, OutputStream output, NamespaceContext nsContext)

marshal

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

marshal

public final void marshal(T object, Node output)

marshal

public final void marshal(BridgeContext context, T object, Node output)

marshal

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

marshal

public final void marshal(T object, ContentHandler contentHandler)

Since: 2.0 EA4

marshal

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

Since: 2.0.2

marshal

public final void marshal(BridgeContext context, T object, ContentHandler contentHandler)

marshal

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

marshal

public final void marshal(T object, Result result)

Since: 2.0 EA4

marshal

public final void marshal(BridgeContext context, T object, Result result)

marshal

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

unmarshal

T unmarshal(XMLStreamReader in)
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: JAXBException if there was an error while unmarshalling.

Since: 2.0 EA1

unmarshal

T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au)

Since: 2.0.3

unmarshal

T unmarshal(BridgeContext context, XMLStreamReader in)

unmarshal

T unmarshal(Unmarshaller u, XMLStreamReader in)

unmarshal

T unmarshal(Source in)
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: JAXBException if there was an error while unmarshalling.

Since: 2.0 EA1

unmarshal

T unmarshal(Source in, AttachmentUnmarshaller au)

Since: 2.0.3

unmarshal

T unmarshal(BridgeContext context, Source in)

unmarshal

T unmarshal(Unmarshaller u, Source in)

unmarshal

T unmarshal(InputStream in)
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: JAXBException if there was an error while unmarshalling.

Since: 2.0 EA1

unmarshal

T unmarshal(BridgeContext context, InputStream in)

unmarshal

T unmarshal(Unmarshaller u, InputStream in)

unmarshal

T unmarshal(Node n)
Unmarshals the specified type object.

Parameters: n Node to be unmarshalled.

Returns: never null.

Throws: JAXBException if there was an error while unmarshalling.

Since: 2.0 FCS

unmarshal

T unmarshal(Node n, AttachmentUnmarshaller au)

Since: 2.0.3

unmarshal

T unmarshal(BridgeContext context, Node n)

unmarshal

T unmarshal(Unmarshaller context, Node n)