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

public abstract Class Loader

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.ProxyLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StructureLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.TextLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext.DefaultRootLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext.ExpectedTypeRootLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.ValuePropertyLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XsiTypeLoader, org.glassfish.jaxb.runtime.v2.runtime.ArrayBeanInfoImpl.ArrayLoader, org.glassfish.jaxb.runtime.v2.runtime.ElementBeanInfoImpl.IntercepterLoader, org.glassfish.jaxb.runtime.v2.runtime.property.ArrayERProperty.ItemsLoader, org.glassfish.jaxb.runtime.v2.runtime.property.ArrayReferenceNodeProperty.MixedTextLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.DefaultValueLoaderDecorator, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Discarder, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.DomLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.LeafPropertyLoader, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.LeafPropertyXsiLoader
Imports
org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo, jakarta.xml.bind.Unmarshaller, .ValidationEvent, jakarta.xml.bind.helpers.ValidationEventImpl, org.xml.sax.SAXException, javax.xml.namespace.QName, java.util.Collection, .Collections

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
protected boolean

Constructor Summary

AccessConstructor and Description
protected
Loader(boolean expectText)

protected

Method Summary

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

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

private String
computeExpectedElements()

Computes the names of possible root elements for a better error diagnosis.

public final boolean
expectText()

True if this loader expects the text(UnmarshallingContext.State, CharSequence) method to be called.

protected final void
fireAfterUnmarshal(JaxBeanInfo<BeanT> beanInfo, Object child, UnmarshallingContext.State
state of the parent object
state
)

Fires the afterUnmarshal event if necessary.

protected final void
fireBeforeUnmarshal(JaxBeanInfo<BeanT> beanInfo, Object child, UnmarshallingContext.State
state of the newly create child object.
state
)

Fires the beforeUnmarshal event if necessary.

public Collection<QName>
getExpectedAttributes()

Returns a set of tag names expected as possible child elements in this context.

public Collection<QName>
getExpectedChildElements()

Returns a set of tag names expected as possible child elements in this context.

public static void
protected static void
handleGenericException(Exception e)

Last resort when something goes terribly wrong within the unmarshaller.

public static void
handleGenericException(Exception e, boolean canRecover)

protected static void
handleParseConversionException(UnmarshallingContext.State state, Exception e)

This method is called by the generated derived class when a datatype parse method throws an exception.

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

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

protected static void
reportError(String msg, boolean canRecover)

public static void
reportError(String msg, Exception nested, boolean canRecover)

protected final void
reportUnexpectedChildElement(TagName ea, boolean canRecover)

public void
startElement(UnmarshallingContext.State state, TagName
info about the start tag. never null.
ea
)

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)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

expectTextback to summary
protected boolean expectText

Constructor Detail

Loaderback to summary
protected Loader(boolean expectText)
Loaderback to summary
protected Loader()

Method Detail

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

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.

computeExpectedElementsback to summary
private String computeExpectedElements()

Computes the names of possible root elements for a better error diagnosis.

expectTextback to summary
public final boolean expectText()

True if this loader expects the text(UnmarshallingContext.State, CharSequence) method to be called. False otherwise.

fireAfterUnmarshalback to summary
protected final void fireAfterUnmarshal(JaxBeanInfo<BeanT> beanInfo, Object child, UnmarshallingContext.State state) throws SAXException

Fires the afterUnmarshal event if necessary.

Parameters
state:UnmarshallingContext.State

state of the parent object

fireBeforeUnmarshalback to summary
protected final void fireBeforeUnmarshal(JaxBeanInfo<BeanT> beanInfo, Object child, UnmarshallingContext.State state) throws SAXException

Fires the beforeUnmarshal event if necessary.

Parameters
state:UnmarshallingContext.State

state of the newly create child object.

getExpectedAttributesback to summary
public Collection<QName> getExpectedAttributes()

Returns a set of tag names expected as possible child elements in this context.

getExpectedChildElementsback to summary
public Collection<QName> getExpectedChildElements()

Returns a set of tag names expected as possible child elements in this context.

handleGenericErrorback to summary
public static void handleGenericError(Error e) throws SAXException
handleGenericExceptionback to summary
protected static void handleGenericException(Exception e) throws SAXException

Last resort when something goes terribly wrong within the unmarshaller.

handleGenericExceptionback to summary
public static void handleGenericException(Exception e, boolean canRecover) throws SAXException
handleParseConversionExceptionback to summary
protected static void handleParseConversionException(UnmarshallingContext.State state, Exception e) throws SAXException

This method is called by the generated derived class when a datatype parse method throws an exception.

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

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

reportErrorback to summary
protected static void reportError(String msg, boolean canRecover) throws SAXException
reportErrorback to summary
public static void reportError(String msg, Exception nested, boolean canRecover) throws SAXException
reportUnexpectedChildElementback to summary
protected final void reportUnexpectedChildElement(TagName ea, boolean canRecover) throws SAXException
Annotations
@SuppressWarnings:StringEquality
startElementback to summary
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException

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.

Parameters
ea:TagName

info about the start tag. never null.

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

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.