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

public Class DomLoader<ResultT extends Result>

extends Loader
Class Inheritance
Imports
org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl, jakarta.xml.bind.annotation.DomHandler, org.xml.sax.SAXException, javax.xml.transform.Result, javax.xml.transform.sax.TransformerHandler

Loads a DOM.
Author
Kohsuke Kawaguchi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
DomLoader.State

Used to capture the state.

Field Summary

Modifier and TypeField and Description
private final DomHandler<?, ResultT>
Inherited from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader:
expectText

Constructor Summary

AccessConstructor and Description
public
DomLoader(DomHandler<?, ResultT> dom)

Method Summary

Modifier and TypeMethod and Description
public void
childElement(UnmarshallingContext.State state, TagName ea)

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.childElement.

Called when this loaderis an active loaderand we see a new child start tag.

public void
leaveElement(UnmarshallingContext.State state, TagName ea)

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.leaveElement.

Called when this loaderis an active loaderand we see an end tag.

public void
startElement(UnmarshallingContext.State state, TagName ea)

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.startElement.

Called when the loader is activated, which is when a new start tag is seen and when the parent designated this loader as the child loader.

public void
text(UnmarshallingContext.State state, CharSequence text)

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.text.

Called when this loaderis an active loaderand we see a chunk of text.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader:
expectTextfireAfterUnmarshalfireBeforeUnmarshalgetExpectedAttributesgetExpectedChildElementshandleGenericErrorhandleGenericExceptionhandleGenericExceptionhandleParseConversionExceptionreportErrorreportErrorreportUnexpectedChildElement

Field Detail

domback to summary
private final DomHandler<?, ResultT> dom

Constructor Detail

DomLoaderback to summary
public DomLoader(DomHandler<?, ResultT> dom)

Method Detail

childElementback to summary
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.childElement.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.childElement.

Called when this loaderis an active loaderand we see a new child start tag.

The callee is expected to designate another loaderas a loaderthat processes this element, then it should also register a Receiver. The designated loaderwill become an active loader.

The default implementation reports an error saying an element is unexpected.

Annotations
@Override
leaveElementback to summary
public void leaveElement(UnmarshallingContext.State state, TagName ea) throws SAXException

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.leaveElement.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.leaveElement.

Called when this loaderis an active loaderand we see an end tag.

Annotations
@Override
startElementback to summary
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.startElement.

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

Called when the loader is activated, which is when a new start tag is seen and when the parent designated this loader as the child loader.

The callee may change state.loader to designate another for the processing. It's the responsibility of the callee to forward the startElement event in such a case.

Annotations
@Override
textback to summary
public void text(UnmarshallingContext.State state, CharSequence text) throws SAXException

Overrides org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.text.

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

Called when this loaderis an active loaderand we see a chunk of text. The runtime makes sure that adjacent characters (even those separated by comments, PIs, etc) are reported as one event. IOW, you won't see two text event calls in a row.

Annotations
@Override
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller back to summary

private final Class DomLoader.State

extends Object
Class Inheritance
  • java.lang.Object
  • org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.DomLoader.State

Used to capture the state. This instance is created for each unmarshalling episode.

Field Summary

Modifier and TypeField and Description
pack-priv int
private TransformerHandler
handler

This handler will receive SAX events.

private final ResultT
result

handler will produce this result.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public Object
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

depthback to summary
pack-priv int depth
handlerback to summary
private TransformerHandler handler

This handler will receive SAX events.

resultback to summary
private final ResultT result

handler will produce this result.

Constructor Detail

Stateback to summary
public State(UnmarshallingContext context) throws SAXException

Method Detail

declarePrefixesback to summary
private void declarePrefixes(UnmarshallingContext context, String[] prefixes) throws SAXException
getElementback to summary
public Object getElement()
undeclarePrefixesback to summary
private void undeclarePrefixes(String[] prefixes) throws SAXException