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

pack-priv Class TypeInfoSetImpl<T, C, F, M>

extends Object
implements TypeInfoSet<T, C, F, M>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.core.v2.model.core.TypeInfoSet
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.model.impl.RuntimeTypeInfoSetImpl
Imports
org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader, org.glassfish.jaxb.core.v2.model.core.*, org.glassfish.jaxb.core.v2.model.nav.Navigator, org.glassfish.jaxb.core.v2.runtime.IllegalAnnotationException, .RuntimeUtil, org.glassfish.jaxb.core.v2.util.FlattenIterator, jakarta.xml.bind.JAXBContext, .JAXBException, .Marshaller, jakarta.xml.bind.annotation.*, jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter, javax.xml.namespace.QName, javax.xml.transform.Result, java.util.*

Set of TypeInfos.

This contains a fixed set of LeafInfos and arbitrary set of ClassInfos.

Members are annotated with JAXB annotations so that we can dump it easily.

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private final Iterable<? extends ElementInfoImpl<T, C, F, M>>
private final NonElement<T, C>
anyType

TypeInfo for xs:anyType.

private final Map<T, ArrayInfoImpl<T, C, F, M>>
private final Map<C, ClassInfoImpl<T, C, F, M>>
beans

All the user-defined classes.

private final Map<C, ClassInfoImpl<T, C, F, M>>
private final Map<T, BuiltinLeafInfo<T, C>>
builtins

All the leaves.

private final Map<C, Map<QName, ElementInfoImpl<T, C, F, M>>>
elementMappings

The element mapping.

private final Map<C, EnumLeafInfoImpl<T, C, F, M>>
public final AnnotationReader<T, C, F, M>
private Map<String, Map<String, String>>
xmlNsCache

Lazily parsed set of XmlNss.

Constructor Summary

AccessConstructor and Description
public
TypeInfoSetImpl(Navigator<T, C, F, M> nav, AnnotationReader<T, C, F, M> reader, Map<T, ? extends BuiltinLeafInfoImpl<T, C>> leaves)

Method Summary

Modifier and TypeMethod and Description
public void
add(ClassInfoImpl<T, C, F, M> ci)

Adds a new ClassInfo to the set.

public void
add(EnumLeafInfoImpl<T, C, F, M> li)

Adds a new LeafInfo to the set.

public void
add(ArrayInfoImpl<T, C, F, M> ai)

public final void
add(ElementInfoImpl<T, C, F, M> ei, ModelBuilder<T, C, F, M>
used for reporting errors.
builder
)

public Map<? extends T, ? extends ArrayInfoImpl<T, C, F, M>>
arrays()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.arrays.

Returns all the ArrayInfos known to this set.

public Map<C, ? extends ClassInfoImpl<T, C, F, M>>
beans()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.beans.

Returns all the ClassInfos known to this set.

public Map<T, ? extends BuiltinLeafInfo<T, C>>
protected NonElement<T, C>
public void
dump(Result out)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.dump.

Dumps this model into XML.

public Map<C, ? extends EnumLeafInfoImpl<T, C, F, M>>
enums()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.enums.

Returns all the EnumLeafInfos known to this set.

public Iterable<? extends ElementInfoImpl<T, C, F, M>>
public NonElement<T, C>
public final XmlNsForm
public NonElement<T, C>

Returns:

null if the specified type is not bound by JAXB or otherwise unknown to this set.
getClassInfo
(C type)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getClassInfo.

Returns a ClassInfo for the given bean.

public final XmlNsForm
public ElementInfoImpl<T, C, F, M>
getElementInfo(C scope, QName name)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getElementInfo.

Returns a ElementInfo for the given element.

public Map<QName, ? extends ElementInfoImpl<T, C, F, M>>
public Navigator<T, C, F, M>
public Map<String, String>
public NonElement<T, C>

Returns:

null if the specified type cannot be bound by JAXB, or not known to this set.
getTypeInfo
(T type)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getTypeInfo.

Returns a TypeInfo for the given type.

public NonElement<T, C>
public Map<String, String>
getXmlNs(String namespaceUri)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getXmlNs.

Gets all XmlSchema#xmlns() found in this context for the given namespace URI.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allElementsback to summary
private final Iterable<? extends ElementInfoImpl<T, C, F, M>> allElements
anyTypeback to summary
private final NonElement<T, C> anyType

TypeInfo for xs:anyType. anyType is the only TypeInfo that works with an interface, and accordingly it requires a lot of special casing.

arraysback to summary
private final Map<T, ArrayInfoImpl<T, C, F, M>> arrays

All ArrayInfoImpls.

beansback to summary
private final Map<C, ClassInfoImpl<T, C, F, M>> beans

All the user-defined classes. Using LinkedHashMap allows us to process classes in the order they are given to us. When the user incorrectly puts an unexpected class into a reference graph, this causes an error to be reported on a class closer to the user's code.

Annotations
@XmlJavaTypeAdapter:ToStringAdapter
beansViewback to summary
private final Map<C, ClassInfoImpl<T, C, F, M>> beansView
Annotations
@XmlTransient
builtinsback to summary
private final Map<T, BuiltinLeafInfo<T, C>> builtins

All the leaves.

elementMappingsback to summary
private final Map<C, Map<QName, ElementInfoImpl<T, C, F, M>>> elementMappings

The element mapping.

enumsback to summary
private final Map<C, EnumLeafInfoImpl<T, C, F, M>> enums

All EnumLeafInfoImpls.

readerback to summary
public final AnnotationReader<T, C, F, M> reader
Annotations
@XmlTransient
xmlNsCacheback to summary
private Map<String, Map<String, String>> xmlNsCache

Lazily parsed set of XmlNss.

See Also
getXmlNs(String)

Constructor Detail

TypeInfoSetImplback to summary
public TypeInfoSetImpl(Navigator<T, C, F, M> nav, AnnotationReader<T, C, F, M> reader, Map<T, ? extends BuiltinLeafInfoImpl<T, C>> leaves)

Method Detail

addback to summary
public void add(ClassInfoImpl<T, C, F, M> ci)

Adds a new ClassInfo to the set.

addback to summary
public void add(EnumLeafInfoImpl<T, C, F, M> li)

Adds a new LeafInfo to the set.

addback to summary
public void add(ArrayInfoImpl<T, C, F, M> ai)
addback to summary
public final void add(ElementInfoImpl<T, C, F, M> ei, ModelBuilder<T, C, F, M> builder)
Parameters
builder:ModelBuilder<T, C, F, M>

used for reporting errors.

arraysback to summary
public Map<? extends T, ? extends ArrayInfoImpl<T, C, F, M>> arrays()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.arrays.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.arrays.

Returns all the ArrayInfos known to this set.

Annotations
@Override
beansback to summary
public Map<C, ? extends ClassInfoImpl<T, C, F, M>> beans()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.beans.

Returns all the ClassInfos known to this set.

Annotations
@Override
builtinsback to summary
public Map<T, ? extends BuiltinLeafInfo<T, C>> builtins()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.builtins.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.builtins.

Returns all the BuiltinLeafInfos known to this set.

Annotations
@Override
createAnyTypeback to summary
protected NonElement<T, C> createAnyType()
dumpback to summary
public void dump(Result out) throws JAXBException

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.dump.

Dumps this model into XML. For debug only.

Todo

not sure if this actually works. We don't really know what are T,C.

Annotations
@Override
enumsback to summary
public Map<C, ? extends EnumLeafInfoImpl<T, C, F, M>> enums()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.enums.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.enums.

Returns all the EnumLeafInfos known to this set.

Annotations
@Override
getAllElementsback to summary
public Iterable<? extends ElementInfoImpl<T, C, F, M>> getAllElements()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getAllElements.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getAllElements.

Returns all the ElementInfo known to this set.

Annotations
@Override
getAnyTypeInfoback to summary
public NonElement<T, C> getAnyTypeInfo()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getAnyTypeInfo.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getAnyTypeInfo.

Gets the TypeInfo for the any type.

Annotations
@Override
getAttributeFormDefaultback to summary
public final XmlNsForm getAttributeFormDefault(String nsUri)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getAttributeFormDefault.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getAttributeFormDefault.

Gets the reasonable XmlNsForm for the given namespace URI.

The spec doesn't define very precisely what the XmlNsForm value for the given namespace would be, so this method is implemented in rather ad-hoc way. It should work as what most people expect for simple cases.

Annotations
@Override
getClassInfoback to summary
public NonElement<T, C> getClassInfo(C type)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getClassInfo.

Returns a ClassInfo for the given bean.

This method is almost like refinement of getTypeInfo(Object) except our C cannot derive from T.

Returns:NonElement<T, C>

null if the specified type is not bound by JAXB or otherwise unknown to this set.

Annotations
@Override
getElementFormDefaultback to summary
public final XmlNsForm getElementFormDefault(String nsUri)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getElementFormDefault.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getElementFormDefault.

Gets the reasonable XmlNsForm for the given namespace URI.

The spec doesn't define very precisely what the XmlNsForm value for the given namespace would be, so this method is implemented in rather ad-hoc way. It should work as what most people expect for simple cases.

Annotations
@Override
getElementInfoback to summary
public ElementInfoImpl<T, C, F, M> getElementInfo(C scope, QName name)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getElementInfo.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getElementInfo.

Returns a ElementInfo for the given element.

Annotations
@Override
getElementMappingsback to summary
public Map<QName, ? extends ElementInfoImpl<T, C, F, M>> getElementMappings(C scope)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getElementMappings.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getElementMappings.

Returns all ElementInfos in the given scope.

Annotations
@Override
getNavigatorback to summary
public Navigator<T, C, F, M> getNavigator()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getNavigator.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getNavigator.

Navigator for this model.

Annotations
@Override
getSchemaLocationsback to summary
public Map<String, String> getSchemaLocations()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getSchemaLocations.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getSchemaLocations.

Gets XmlSchema#location() found in this context.

This operation is expected to be only used in schema generator, so it can be slow.

Annotations
@Override
getTypeInfoback to summary
public NonElement<T, C> getTypeInfo(T type)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getTypeInfo.

Returns a TypeInfo for the given type.

Returns:NonElement<T, C>

null if the specified type cannot be bound by JAXB, or not known to this set.

Annotations
@Override
getTypeInfoback to summary
public NonElement<T, C> getTypeInfo(Ref<T, C> ref)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getTypeInfo, org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getTypeInfo.

This method is used to add a root reference to a model.

Annotations
@Override
getXmlNsback to summary
public Map<String, String> getXmlNs(String namespaceUri)

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getXmlNs.

Doc from org.glassfish.jaxb.core.v2.model.core.TypeInfoSet.getXmlNs.

Gets all XmlSchema#xmlns() found in this context for the given namespace URI.

This operation is expected to be only used in schema generator, so it can be slow.

Annotations
@Override