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

pack-priv final Class ArrayBeanInfoImpl

extends JaxBeanInfo
Class Inheritance
Imports
org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeArrayInfo, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader, .Receiver, .TagName, .UnmarshallingContext, jakarta.xml.bind.ValidationEvent, jakarta.xml.bind.helpers.ValidationEventImpl, org.xml.sax.SAXException, javax.xml.namespace.QName, javax.xml.stream.XMLStreamException, java.io.IOException, java.lang.reflect.Array, java.util.ArrayList, .Collection, .Collections, .List

JaxBeanInfo implementation that binds T[] to a complex type with an element for each item.
Author
Kohsuke Kawaguchi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final JaxBeanInfo<BeanT>
private final Class<T>
private Loader
Inherited from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo:
flagisNilIncludedjaxbType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
createInstance(UnmarshallingContext context)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.createInstance.

Creates a new instance of the bean.

public String
getElementLocalName(Object array)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getElementLocalName.

Returns the local name portion of the element name, if the bean that this class represents is mapped from/to an XML element.

public String
getElementNamespaceURI(Object array)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getElementNamespaceURI.

Returns the namespace URI portion of the element name, if the bean that this class represents is mapped from/to an XML element.

public String
getId(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getId.

Gets the ID value of the given bean, if it has an ID value.

public Loader
getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getLoader.

Gets the Loader that will unmarshall the given object.

public Transducer<ValueT>
getTransducer()

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getTransducer.

If the bean's representation in XML is just a text, this method return a Transducer that lets you convert values between the text and the bean.

public boolean
reset(Object array, UnmarshallingContext context)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.reset.

Resets the object to the initial state, as if the object is created fresh.

public void
serializeAttributes(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeAttributes.

Serializes attributes into the specified target.

public void
serializeBody(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeBody.

Serializes child elements and texts into the specified target.

public void
serializeRoot(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeRoot.

Serializes the bean as the root element.

public void
serializeURIs(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeURIs.

Declares all the namespace URIs this object is using at its top-level scope into the specified target.

protected Object
toArray(List<E> list)

Inherited from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo:
getLifecycleMethodsgetTypeNamegetTypeNameshasAfterMarshalMethodhasAfterUnmarshalMethodhasBeforeMarshalMethodhasBeforeUnmarshalMethodhasElementOnlyContentModelhasElementOnlyContentModelinvokeAfterUnmarshalMethodinvokeBeforeUnmarshalMethodisElementisImmutableisNilIncludedlookForLifecycleMethodssetLifecycleFlagswrapUp

Field Detail

itemBeanInfoback to summary
private final JaxBeanInfo<BeanT> itemBeanInfo
itemTypeback to summary
private final Class<T> itemType
loaderback to summary
private Loader loader

Constructor Detail

ArrayBeanInfoImplback to summary
public ArrayBeanInfoImpl(JAXBContextImpl owner, RuntimeArrayInfo rai)

Method Detail

createInstanceback to summary
public Object createInstance(UnmarshallingContext context)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.createInstance.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.createInstance.

Creates a new instance of the bean.

This operation is only supported when isImmutable is false.

Annotations
@Override
getElementLocalNameback to summary
public String getElementLocalName(Object array)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getElementLocalName.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getElementLocalName.

Returns the local name portion of the element name, if the bean that this class represents is mapped from/to an XML element.

Annotations
@Override
getElementNamespaceURIback to summary
public String getElementNamespaceURI(Object array)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getElementNamespaceURI.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getElementNamespaceURI.

Returns the namespace URI portion of the element name, if the bean that this class represents is mapped from/to an XML element.

Annotations
@Override
getIdback to summary
public String getId(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getId.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getId.

Gets the ID value of the given bean, if it has an ID value. Otherwise return null.

Annotations
@Override
getLoaderback to summary
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getLoader.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getLoader.

Gets the Loader that will unmarshall the given object.

Annotations
@Override
getTransducerback to summary
public Transducer<ValueT> getTransducer()

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getTransducer.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.getTransducer.

If the bean's representation in XML is just a text, this method return a Transducer that lets you convert values between the text and the bean.

Annotations
@Override
resetback to summary
public boolean reset(Object array, UnmarshallingContext context)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.reset.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.reset.

Resets the object to the initial state, as if the object is created fresh.

This is used to reuse an existing object for unmarshalling.

Annotations
@Override
serializeAttributesback to summary
public void serializeAttributes(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeAttributes.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeAttributes.

Serializes attributes into the specified target.

Annotations
@Override
serializeBodyback to summary
public void serializeBody(Object array, XMLSerializer target) throws SAXException, IOException, XMLStreamException

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeBody.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeBody.

Serializes child elements and texts into the specified target.

Annotations
@Override
serializeRootback to summary
public void serializeRoot(Object array, XMLSerializer target) throws SAXException, IOException, XMLStreamException

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeRoot.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeRoot.

Serializes the bean as the root element.

In the java-to-schema binding, an object might marshal in two different ways depending on whether it is used as the root of the graph or not. In the former case, an object could marshal as an element, whereas in the latter case, it marshals as a type.

This method is used to marshal the root of the object graph to allow this semantics to be implemented.

It is doubtful to me if it's a good idea for an object to marshal in two ways depending on the context.

For schema-to-java, this is equivalent to serializeBody(Object, XMLSerializer).

Annotations
@Override
serializeURIsback to summary
public void serializeURIs(Object array, XMLSerializer target)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeURIs.

Doc from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.serializeURIs.

Declares all the namespace URIs this object is using at its top-level scope into the specified target.

Annotations
@Override
toArrayback to summary
protected Object toArray(List<E> list)
org.glassfish.jaxb.runtime.v2.runtime back to summary

private final Class ArrayBeanInfoImpl.ArrayLoader

extends Loader
implements Receiver
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Receiver

Field Summary

Modifier and TypeField and Description
private final Loader
Inherited from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader:
expectText

Constructor Summary

AccessConstructor and Description
public

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
receive(UnmarshallingContext.State state, Object o)

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

Called when the child loader is deactivated.

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

itemLoaderback to summary
private final Loader itemLoader

Constructor Detail

ArrayLoaderback to summary
public ArrayLoader(JAXBContextImpl owner)

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)

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
receiveback to summary
public void receive(UnmarshallingContext.State state, Object o)

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
startElementback to summary
public void startElement(UnmarshallingContext.State state, TagName ea)

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