Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller

pack-priv final Class MTOMDecorator

extends Object
implements XmlVisitor
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor
Imports
org.glassfish.jaxb.core.v2.WellKnownNamespace, org.glassfish.jaxb.core.v2.runtime.unmarshaller.LocatorEx, jakarta.activation.DataHandler, jakarta.xml.bind.attachment.AttachmentUnmarshaller, org.xml.sax.SAXException, javax.xml.namespace.NamespaceContext

Decorator of XmlVisitor that performs XOP processing. Used to support MTOM.
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private final AttachmentUnmarshaller
private final Base64Data
private boolean
followXop

UGLY HACK: we need to ignore the whitespace that follows the attached base64 image.

private boolean
inXopInclude

True if we are between the start and the end of xop:Include

private final XmlVisitor
private UnmarshallerImpl

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
endPrefixMapping(String prefix)

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endPrefixMapping.

Called after endElement event to notify the end of a binding.

public UnmarshallingContext
public XmlVisitor.TextPredictor
getPredictor()

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getPredictor.

Gets the predictor that can be used for the caller to avoid calling text(CharSequence) unnecessarily.

public void
public void
startElement(TagName tagName)

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startElement.

Notifies a start tag of a new element.

public void
startPrefixMapping(String prefix, String nsUri)

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startPrefixMapping.

Called before startElement event to notify a new namespace binding.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

auback to summary
private final AttachmentUnmarshaller au
base64databack to summary
private final Base64Data base64data
followXopback to summary
private boolean followXop

UGLY HACK: we need to ignore the whitespace that follows the attached base64 image. This happens twice; once before </xop:Include>, another after </xop:Include>. The spec guarantees that no valid pcdata can follow </xop:Include>.

inXopIncludeback to summary
private boolean inXopInclude

True if we are between the start and the end of xop:Include

nextback to summary
private final XmlVisitor next
parentback to summary
private UnmarshallerImpl parent

Constructor Detail

MTOMDecoratorback to summary
public MTOMDecorator(UnmarshallerImpl parent, XmlVisitor next, AttachmentUnmarshaller au)

Method Detail

endDocumentback to summary
public void endDocument() throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endDocument.

Annotations
@Override
endElementback to summary
public void endElement(TagName tagName) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endElement.

Annotations
@Override
endPrefixMappingback to summary
public void endPrefixMapping(String prefix) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endPrefixMapping.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endPrefixMapping.

Called after endElement event to notify the end of a binding.

Annotations
@Override
getContextback to summary
public UnmarshallingContext getContext()

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getContext.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getContext.

Returns the UnmarshallingContext at the end of the chain.

Annotations
@Override
getPredictorback to summary
public XmlVisitor.TextPredictor getPredictor()

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getPredictor.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getPredictor.

Gets the predictor that can be used for the caller to avoid calling text(CharSequence) unnecessarily.

Annotations
@Override
startDocumentback to summary
public void startDocument(LocatorEx loc, NamespaceContext nsContext) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startDocument.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startDocument.

Notifies a start of the document.

Annotations
@Override
startElementback to summary
public void startElement(TagName tagName) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startElement.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startElement.

Notifies a start tag of a new element. namespace URIs and local names must be interned.

Annotations
@Override
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String nsUri) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startPrefixMapping.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startPrefixMapping.

Called before startElement event to notify a new namespace binding.

Annotations
@Override
textback to summary
public void text(CharSequence pcdata) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.text.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.text.

Text events.

The caller should consult TextPredictor to see if the unmarshaller is expecting any PCDATA. If the above is returning false, the caller is OK to skip any text in XML. The net effect is that we can ignore whitespaces quickly.

Annotations
@Override