com.sun.xml.bind.v2.model.impl

Class TypeInfoSetImpl<T,C,F,M>

class TypeInfoSetImpl<T,C,F,M> extends Object implements TypeInfoSet<T,C,F,M>

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.

Field Summary
Map<C,ClassInfoImpl<T,C,F,M>>beans
All the user-defined classes.
Map<C,ClassInfoImpl<T,C,F,M>>beansView
Navigator<T,C,F,M>nav
AnnotationReader<T,C,F,M>reader
Constructor Summary
TypeInfoSetImpl(Navigator<T,C,F,M> nav, AnnotationReader<T,C,F,M> reader, Map<T,? extends BuiltinLeafInfoImpl<T,C>> leaves)
Method Summary
voidadd(ClassInfoImpl<T,C,F,M> ci)
Adds a new ClassInfo to the set.
voidadd(EnumLeafInfoImpl<T,C,F,M> li)
Adds a new LeafInfo to the set.
voidadd(ArrayInfoImpl<T,C,F,M> ai)
voidadd(ElementInfoImpl<T,C,F,M> ei, ModelBuilder<T,C,F,M> builder)
Map<? extends T,? extends ArrayInfoImpl<T,C,F,M>>arrays()
Map<C,? extends ClassInfoImpl<T,C,F,M>>beans()
Returns all the ClassInfos known to this set.
Map<T,? extends BuiltinLeafInfo<T,C>>builtins()
protected NonElement<T,C>createAnyType()
voiddump(Result out)
Dumps this model into XML.
Map<C,? extends EnumLeafInfoImpl<T,C,F,M>>enums()
Iterable<? extends ElementInfoImpl<T,C,F,M>>getAllElements()
NonElement<T,C>getAnyTypeInfo()
XmlNsFormgetAttributeFormDefault(String nsUri)
NonElement<T,C>getClassInfo(C type)
Returns a ClassInfo for the given bean.
XmlNsFormgetElementFormDefault(String nsUri)
ElementInfoImpl<T,C,F,M>getElementInfo(C scope, QName name)
Map<QName,? extends ElementInfoImpl<T,C,F,M>>getElementMappings(C scope)
Navigator<T,C,F,M>getNavigator()
Map<String,String>getSchemaLocations()
NonElement<T,C>getTypeInfo(T type)
Returns a TypeInfo for the given type.
NonElement<T,C>getTypeInfo(Ref<T,C> ref)
This method is used to add a root reference to a model.
Map<String,String>getXmlNs(String namespaceUri)

Field Detail

beans

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.

beansView

final Map<C,ClassInfoImpl<T,C,F,M>> beansView

nav

final Navigator<T,C,F,M> nav

reader

final AnnotationReader<T,C,F,M> reader

Constructor Detail

TypeInfoSetImpl

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

Method Detail

add

public void add(ClassInfoImpl<T,C,F,M> ci)
Adds a new ClassInfo to the set.

add

public void add(EnumLeafInfoImpl<T,C,F,M> li)
Adds a new LeafInfo to the set.

add

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

add

public final void add(ElementInfoImpl<T,C,F,M> ei, ModelBuilder<T,C,F,M> builder)

Parameters: builder used for reporting errors.

arrays

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

beans

public Map<C,? extends ClassInfoImpl<T,C,F,M>> beans()
Returns all the ClassInfos known to this set.

builtins

public Map<T,? extends BuiltinLeafInfo<T,C>> builtins()

createAnyType

protected NonElement<T,C> createAnyType()

dump

public void dump(Result out)
Dumps this model into XML. For debug only. TODO: not sure if this actually works. We don't really know what are T,C.

enums

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

getAllElements

public Iterable<? extends ElementInfoImpl<T,C,F,M>> getAllElements()

getAnyTypeInfo

public NonElement<T,C> getAnyTypeInfo()

getAttributeFormDefault

public final XmlNsForm getAttributeFormDefault(String nsUri)

getClassInfo

public NonElement<T,C> getClassInfo(C type)
Returns a ClassInfo for the given bean.

This method is almost like refinement of TypeInfoSetImpl except our C cannot derive from T.

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

getElementFormDefault

public final XmlNsForm getElementFormDefault(String nsUri)

getElementInfo

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

getElementMappings

public Map<QName,? extends ElementInfoImpl<T,C,F,M>> getElementMappings(C scope)

getNavigator

public Navigator<T,C,F,M> getNavigator()

getSchemaLocations

public Map<String,String> getSchemaLocations()

getTypeInfo

public NonElement<T,C> getTypeInfo(T type)
Returns a TypeInfo for the given type.

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

getTypeInfo

public NonElement<T,C> getTypeInfo(Ref<T,C> ref)
This method is used to add a root reference to a model.

getXmlNs

public Map<String,String> getXmlNs(String namespaceUri)