Package com.sun.xml.bind.api
Class Bridge<T>
java.lang.Object
com.sun.xml.bind.api.Bridge<T>
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets theJAXBRIContext
to which this object belongs.abstract TypeReference
Gets theTypeReference
from which this bridge was created.final void
marshal
(BridgeContext context, T object, OutputStream output, NamespaceContext nsContext) final void
marshal
(BridgeContext context, T object, XMLStreamWriter output) final void
marshal
(BridgeContext context, T object, Result result) final void
marshal
(BridgeContext context, T object, Node output) final void
marshal
(BridgeContext context, T object, ContentHandler contentHandler) abstract void
marshal
(Marshaller m, T object, OutputStream output, NamespaceContext nsContext) abstract void
marshal
(Marshaller m, T object, XMLStreamWriter output) abstract void
marshal
(Marshaller m, T object, Result result) abstract void
marshal
(Marshaller m, T object, Node output) abstract void
marshal
(Marshaller m, T object, ContentHandler contentHandler) void
marshal
(T object, OutputStream output, NamespaceContext nsContext) Marshals the specified type object with the implicit element name associated with this instance ofBridge
.void
marshal
(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) final void
marshal
(T object, XMLStreamWriter output) final void
marshal
(T object, XMLStreamWriter output, AttachmentMarshaller am) final void
final void
final void
marshal
(T object, ContentHandler contentHandler) final void
marshal
(T object, ContentHandler contentHandler, AttachmentMarshaller am) final T
unmarshal
(BridgeContext context, InputStream in) final T
unmarshal
(BridgeContext context, XMLStreamReader in) final T
unmarshal
(BridgeContext context, Source in) final T
unmarshal
(BridgeContext context, Node n) final T
unmarshal
(InputStream in) Unmarshals the specified type object.abstract T
unmarshal
(Unmarshaller u, InputStream in) abstract T
unmarshal
(Unmarshaller u, XMLStreamReader in) abstract T
unmarshal
(Unmarshaller u, Source in) abstract T
unmarshal
(Unmarshaller context, Node n) final T
Unmarshals the specified type object.final T
final T
Unmarshals the specified type object.final T
unmarshal
(Source in, AttachmentUnmarshaller au) final T
Unmarshals the specified type object.final T
unmarshal
(Node n, AttachmentUnmarshaller au)
-
Field Details
-
context
-
-
Constructor Details
-
Bridge
-
-
Method Details
-
getContext
Gets theJAXBRIContext
to which this object belongs.- Since:
- 2.1
-
marshal
- Throws:
JAXBException
- if there was an error while marshalling.- Since:
- 2.0 EA1
-
marshal
public final void marshal(T object, XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException - Throws:
JAXBException
-
marshal
public final void marshal(@NotNull BridgeContext context, T object, XMLStreamWriter output) throws JAXBException - Throws:
JAXBException
-
marshal
public abstract void marshal(@NotNull Marshaller m, T object, XMLStreamWriter output) throws JAXBException - Throws:
JAXBException
-
marshal
Marshals the specified type object with the implicit element name associated with this instance ofBridge
.- Parameters:
nsContext
- if this marshalling is done to marshal a subelement, thisNamespaceContext
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) throws JAXBException - Throws:
JAXBException
- Since:
- 2.0.2
-
marshal
public final void marshal(@NotNull BridgeContext context, T object, OutputStream output, NamespaceContext nsContext) throws JAXBException - Throws:
JAXBException
-
marshal
public abstract void marshal(@NotNull Marshaller m, T object, OutputStream output, NamespaceContext nsContext) throws JAXBException - Throws:
JAXBException
-
marshal
- Throws:
JAXBException
-
marshal
public final void marshal(@NotNull BridgeContext context, T object, Node output) throws JAXBException - Throws:
JAXBException
-
marshal
- Throws:
JAXBException
-
marshal
- Throws:
JAXBException
- Since:
- 2.0 EA4
-
marshal
public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException - Throws:
JAXBException
- Since:
- 2.0.2
-
marshal
public final void marshal(@NotNull BridgeContext context, T object, ContentHandler contentHandler) throws JAXBException - Throws:
JAXBException
-
marshal
public abstract void marshal(@NotNull Marshaller m, T object, ContentHandler contentHandler) throws JAXBException - Throws:
JAXBException
-
marshal
- Throws:
JAXBException
- Since:
- 2.0 EA4
-
marshal
public final void marshal(@NotNull BridgeContext context, T object, Result result) throws JAXBException - Throws:
JAXBException
-
marshal
- Throws:
JAXBException
-
unmarshal
Unmarshals the specified type object.- Parameters:
in
- the parser must be pointing at a start tag that encloses the XML type that thisBridge
is instanciated for.- Returns:
- never null.
- Throws:
JAXBException
- if there was an error while unmarshalling.- Since:
- 2.0 EA1
-
unmarshal
@NotNull public final T unmarshal(@NotNull XMLStreamReader in, @Nullable AttachmentUnmarshaller au) throws JAXBException - Throws:
JAXBException
- Since:
- 2.0.3
-
unmarshal
@NotNull public final T unmarshal(@NotNull BridgeContext context, @NotNull XMLStreamReader in) throws JAXBException - Throws:
JAXBException
-
unmarshal
@NotNull public abstract T unmarshal(@NotNull Unmarshaller u, @NotNull XMLStreamReader in) throws JAXBException - Throws:
JAXBException
-
unmarshal
Unmarshals the specified type object.- Parameters:
in
- the parser must be pointing at a start tag that encloses the XML type that thisBridge
is instanciated for.- Returns:
- never null.
- Throws:
JAXBException
- if there was an error while unmarshalling.- Since:
- 2.0 EA1
-
unmarshal
@NotNull public final T unmarshal(@NotNull Source in, @Nullable AttachmentUnmarshaller au) throws JAXBException - Throws:
JAXBException
- Since:
- 2.0.3
-
unmarshal
@NotNull public final T unmarshal(@NotNull BridgeContext context, @NotNull Source in) throws JAXBException - Throws:
JAXBException
-
unmarshal
@NotNull public abstract T unmarshal(@NotNull Unmarshaller u, @NotNull Source in) throws JAXBException - Throws:
JAXBException
-
unmarshal
Unmarshals the specified type object.- Parameters:
in
- the parser must be pointing at a start tag that encloses the XML type that thisBridge
is instanciated for.- Returns:
- never null.
- Throws:
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 JAXBException - Throws:
JAXBException
-
unmarshal
@NotNull public abstract T unmarshal(@NotNull Unmarshaller u, @NotNull InputStream in) throws JAXBException - Throws:
JAXBException
-
unmarshal
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
@NotNull public final T unmarshal(@NotNull Node n, @Nullable AttachmentUnmarshaller au) throws JAXBException - Throws:
JAXBException
- Since:
- 2.0.3
-
unmarshal
@NotNull public final T unmarshal(@NotNull BridgeContext context, @NotNull Node n) throws JAXBException - Throws:
JAXBException
-
unmarshal
@NotNull public abstract T unmarshal(@NotNull Unmarshaller context, @NotNull Node n) throws JAXBException - Throws:
JAXBException
-
getTypeReference
Gets theTypeReference
from which this bridge was created.
-