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

pack-priv abstract Class ArrayERProperty<BeanT, ListT, ItemT>

extends ArrayProperty<BeanT, ListT, ItemT>
Class Inheritance
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.runtime.property.ArrayReferenceNodeProperty, org.glassfish.jaxb.runtime.v2.runtime.property.ArrayElementProperty
Imports
org.glassfish.jaxb.runtime.api.AccessorException, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimePropertyInfo, org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl, .Name, .XMLSerializer, org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor, .Lister, org.glassfish.jaxb.runtime.v2.util.QNameMap, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.*, org.xml.sax.SAXException, javax.xml.namespace.QName, javax.xml.stream.XMLStreamException, java.io.IOException, java.util.Collection

Commonality between ArrayElementProperty and ArrayReferenceNodeProperty. Mostly handles the unmarshalling of the wrapper element.
Author
Kohsuke Kawaguchi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ArrayERProperty.ItemsLoader

Used to handle the collection wrapper element.

protected class
ArrayERProperty.ReceiverImpl

Receiver that puts the child object into the Scope object.

Field Summary

Modifier and TypeField and Description
protected final boolean
isWrapperNillable

True if the wrapper tag name is nillable.

protected final Name
wrapperTagName

Wrapper tag name if any, or null.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.property.ArrayProperty:
acclister

Constructor Summary

AccessConstructor and Description
protected
ArrayERProperty(JAXBContextImpl grammar, RuntimePropertyInfo prop, QName tagName, boolean isWrapperNillable)

Method Summary

Modifier and TypeMethod and Description
public final void
buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> loaders)

Implements org.glassfish.jaxb.runtime.v2.runtime.property.StructureLoaderBuilder.buildChildElementUnmarshallers.

Every Property class has an implementation of buildChildElementUnmarshallers which will fill in the specified QNameMap by elements that are expected by this property.

protected abstract void
createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders)

Creates the unmarshaler to unmarshal the body.

public final void
protected abstract void
serializeListBody(BeanT o, XMLSerializer w, ListT
always non-null.
list
)

Serializes the items of the list.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.property.ArrayProperty:
getIdValuereset

Field Detail

isWrapperNillableback to summary
protected final boolean isWrapperNillable

True if the wrapper tag name is nillable. Always false if wrapperTagName==null.

wrapperTagNameback to summary
protected final Name wrapperTagName

Wrapper tag name if any, or null.

Constructor Detail

ArrayERPropertyback to summary
protected ArrayERProperty(JAXBContextImpl grammar, RuntimePropertyInfo prop, QName tagName, boolean isWrapperNillable)

Method Detail

buildChildElementUnmarshallersback to summary
public final void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> loaders)

Implements org.glassfish.jaxb.runtime.v2.runtime.property.StructureLoaderBuilder.buildChildElementUnmarshallers.

Doc from org.glassfish.jaxb.runtime.v2.runtime.property.StructureLoaderBuilder.buildChildElementUnmarshallers.

Every Property class has an implementation of buildChildElementUnmarshallers which will fill in the specified QNameMap by elements that are expected by this property.

Annotations
@Override
createBodyUnmarshallerback to summary
protected abstract void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders)

Creates the unmarshaler to unmarshal the body.

serializeBodyback to summary
public final void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException

Overrides org.glassfish.jaxb.runtime.v2.runtime.property.PropertyImpl.serializeBody.

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.serializeBody.

Annotations
@Override
Exceptions
AccessorException:

Doc from org.glassfish.jaxb.runtime.v2.runtime.property.Property.serializeBody.

If thrown, caught by the caller and reported.

serializeListBodyback to summary
protected abstract void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException, AccessorException

Serializes the items of the list. This method is invoked after the necessary wrapper tag is produced (if necessary.)

Parameters
list:ListT

always non-null.

org.glassfish.jaxb.runtime.v2.runtime.property back to summary

private final Class ArrayERProperty.ItemsLoader

extends Loader
Class Inheritance

Used to handle the collection wrapper element.

Field Summary

Modifier and TypeField and Description
private final Accessor<BeanT, ValueT>
private final QNameMap<ChildLoader>
private final Lister<BeanT, PropT, ItemT, PackT>
Inherited from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader:
expectText

Constructor Summary

AccessConstructor and Description
public
ItemsLoader(Accessor<BeanT, ValueT> acc, Lister<BeanT, PropT, ItemT, PackT> lister, QNameMap<ChildLoader> children)

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 Collection<QName>
getExpectedChildElements()

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

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

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.

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

Field Detail

accback to summary
private final Accessor<BeanT, ValueT> acc
childrenback to summary
private final QNameMap<ChildLoader> children
listerback to summary
private final Lister<BeanT, PropT, ItemT, PackT> lister

Constructor Detail

ItemsLoaderback to summary
public ItemsLoader(Accessor<BeanT, ValueT> acc, Lister<BeanT, PropT, ItemT, PackT> lister, QNameMap<ChildLoader> children)

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
getExpectedChildElementsback to summary
public Collection<QName> getExpectedChildElements()

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

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

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

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
org.glassfish.jaxb.runtime.v2.runtime.property back to summary

protected final Class ArrayERProperty.ReceiverImpl

extends Object
implements Receiver
Class Inheritance
  • java.lang.Object
  • org.glassfish.jaxb.runtime.v2.runtime.property.ArrayERProperty.ReceiverImpl
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Receiver

Receiver that puts the child object into the Scope object.

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
protected
ReceiverImpl(int offset)

Method Summary

Modifier and TypeMethod and Description
public void
receive(UnmarshallingContext.State state, Object o)

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Receiver.receive.

Called when the child loader is deactivated.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

offsetback to summary
private final int offset

Constructor Detail

ReceiverImplback to summary
protected ReceiverImpl(int offset)

Method Detail

receiveback to summary
public void receive(UnmarshallingContext.State state, Object o) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Receiver.receive.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Receiver.receive.

Called when the child loader is deactivated.

Annotations
@Override