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

public final Class ClassBeanInfoImpl<BeanT>

extends JaxBeanInfo<BeanT>
implements AttributeAccessor<BeanT>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.AttributeAccessor
Imports
com.sun.istack.FinalArrayList, org.glassfish.jaxb.runtime.api.AccessorException, org.glassfish.jaxb.core.v2.ClassFactory, org.glassfish.jaxb.core.v2.model.core.ID, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo, .RuntimePropertyInfo, org.glassfish.jaxb.runtime.v2.runtime.property.AttributeProperty, .Property, .PropertyFactory, org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader, .StructureLoader, .UnmarshallingContext, .XsiTypeLoader, jakarta.xml.bind.ValidationEvent, jakarta.xml.bind.annotation.XmlRootElement, jakarta.xml.bind.helpers.ValidationEventImpl, org.xml.sax.Locator, .SAXException, org.xml.sax.helpers.LocatorImpl, javax.xml.XMLConstants, javax.xml.namespace.QName, javax.xml.stream.XMLStreamException, java.io.IOException, java.lang.reflect.InvocationTargetException, .Method, .Modifier, java.util.Collection, .Collections, .List, .Map, java.util.logging.Level, .Logger

JaxBeanInfo implementation for j2s bean.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private AttributeProperty<BeanT>[]
attributeProperties

The AttributePropertys for this type and all its ancestors.

private RuntimeClassInfo
ci

Set only until the link phase to avoid leaking memory.

private static final AttributeProperty<BeanT>[]
private final Method
private Property<? super BeanT>
idProperty

Non-null if this bean has an ID property.

private final Accessor<? super BeanT, Map<QName, String>>
private Loader
loader

Immutable configured loader for this class.

private Loader
private static final Logger
public final Property<BeanT>[]
properties

Properties of this bean class but not its ancestor classes.

private boolean
public final ClassBeanInfoImpl<? super BeanT>
superClazz

ClassBeanInfoImpl that represents the super class of jaxbType.

private final Name
private Property<BeanT>[]
private final Transducer<BeanT>
private final Accessor<? super BeanT, Locator>
Inherited from org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo:
flagisNilIncludedjaxbType

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
public BeanT
createInstance(UnmarshallingContext context)

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

Creates a new instance of the bean.

public String
getElementLocalName(BeanT bean)

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(BeanT bean)

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(BeanT bean, 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<BeanT>
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(BeanT bean, 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(BeanT bean, XMLSerializer target)

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

Serializes attributes into the specified target.

public void
serializeBody(BeanT bean, XMLSerializer target)

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

Serializes child elements and texts into the specified target.

public void
serializeRoot(BeanT bean, XMLSerializer target)

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

Serializes the bean as the root element.

public void
serializeURIs(BeanT bean, 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.

public void
wrapUp()

Overrides org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.wrapUp.

Called at the end of the JAXBContext initialization phase to clean up any unnecessary references.

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

Field Detail

attributePropertiesback to summary
private AttributeProperty<BeanT>[] attributeProperties

The AttributePropertys for this type and all its ancestors. If JAXBContextImpl#c14nSupport is true, this is sorted alphabetically.

ciback to summary
private RuntimeClassInfo ci

Set only until the link phase to avoid leaking memory.

EMPTY_PROPERTIESback to summary
private static final AttributeProperty<BeanT>[] EMPTY_PROPERTIES
factoryMethodback to summary
private final Method factoryMethod
idPropertyback to summary
private Property<? super BeanT> idProperty

Non-null if this bean has an ID property.

inheritedAttWildcardback to summary
private final Accessor<? super BeanT, Map<QName, String>> inheritedAttWildcard
loaderback to summary
private Loader loader

Immutable configured loader for this class.

Set from the link method, but considered final.

loaderWithTypeSubstback to summary
private Loader loaderWithTypeSubst
loggerback to summary
private static final Logger logger

Hides org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.logger.

propertiesback to summary
public final Property<BeanT>[] properties

Properties of this bean class but not its ancestor classes.

retainPropertyInfoback to summary
private boolean retainPropertyInfo
superClazzback to summary
public final ClassBeanInfoImpl<? super BeanT> superClazz

ClassBeanInfoImpl that represents the super class of jaxbType.

tagNameback to summary
private final Name tagName
uriPropertiesback to summary
private Property<BeanT>[] uriProperties

Propertys that need to receive Property#serializeURIs(Object, XMLSerializer) callback.

xducerback to summary
private final Transducer<BeanT> xducer
xmlLocatorFieldback to summary
private final Accessor<? super BeanT, Locator> xmlLocatorField

Constructor Detail

ClassBeanInfoImplback to summary
pack-priv ClassBeanInfoImpl(JAXBContextImpl owner, RuntimeClassInfo ci)

Method Detail

checkOverridePropertiesback to summary
private void checkOverrideProperties(Property<BeanT> p)
createInstanceback to summary
public BeanT createInstance(UnmarshallingContext context) throws IllegalAccessException, InvocationTargetException, InstantiationException, SAXException

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(BeanT bean)

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(BeanT bean)

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(BeanT bean, XMLSerializer target) throws SAXException

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<BeanT> 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(BeanT bean, UnmarshallingContext context) throws SAXException

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
Exceptions
SAXException:
as a result of reporting an error, the context may throw a SAXException.
serializeAttributesback to summary
public void serializeAttributes(BeanT bean, XMLSerializer target) throws SAXException, IOException, XMLStreamException

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(BeanT bean, 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(BeanT bean, 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(BeanT bean, XMLSerializer target) throws SAXException

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
wrapUpback to summary
public void wrapUp()

Overrides org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo.wrapUp.

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

Called at the end of the JAXBContext initialization phase to clean up any unnecessary references.

Annotations
@Override