}
this.fastBoot = fastB;
System.arraycopy(classes,0,this.classes,0,classes.length);
RuntimeTypeInfoSet typeSet = getTypeInfoSet();
// at least prepare the empty table so that we don't have to check for null later
elements.put(null,new LinkedHashMap<QName, ElementBeanInfoImpl>());
// recognize leaf bean infos
for( RuntimeBuiltinLeafInfo leaf : RuntimeBuiltinLeafInfoImpl.builtinBeanInfos ) {
LeafBeanInfoImpl<?> bi = new LeafBeanInfoImpl(this,leaf);
beanInfoMap.put(leaf.getClazz(),bi);
for( QName t : bi.getTypeNames() )
typeMap.put(t,bi);
}
for (RuntimeEnumLeafInfo e : typeSet.enums().values()) {
JaxBeanInfo<?> bi = getOrCreate(e);
for (QName qn : bi.getTypeNames())
typeMap.put( qn, bi );
if(e.isElement())
rootMap.put( e.getElementName(), bi );
}
for (RuntimeArrayInfo a : typeSet.arrays().values()) {
JaxBeanInfo<?> ai = getOrCreate(a);
for (QName qn : ai.getTypeNames())
typeMap.put( qn, ai );
}
for( RuntimeClassInfo ci : typeSet.beans().values() ) {
ClassBeanInfoImpl<?> bi = getOrCreate(ci);
if(bi.isElement())
rootMap.put( ci.getElementName(), bi );
for (QName qn : bi.getTypeNames())
typeMap.put( qn, bi );
}
// fill in element mappings
for( RuntimeElementInfo n : typeSet.getAllElements() ) {
ElementBeanInfoImpl bi = getOrCreate(n);
if(n.getScope()==null)
rootMap.put(n.getElementName(),bi);
RuntimeClassInfo scope = n.getScope();
Class scopeClazz = scope==null?null:scope.getClazz();
Map<QName,ElementBeanInfoImpl> m = elements.get(scopeClazz);
if(m==null) {
m = new LinkedHashMap<QName, ElementBeanInfoImpl>();
elements.put(scopeClazz,m);
}
m.put(n.getElementName(),bi);
}
// this one is so that we can handle plain JAXBElements.
beanInfoMap.put(JAXBElement.class,new ElementBeanInfoImpl(this));
// another special BeanInfoImpl just for marshalling
beanInfoMap.put(CompositeStructure.class,new CompositeStructureBeanInfo(this));
getOrCreate(typeSet.getAnyTypeInfo());
// then link them all!
for (JaxBeanInfo bi : beanInfos.values())
bi.link(this);
// register primitives for boxed types just to make GrammarInfo fool-proof
for( Map.Entry<Class,Class> e : RuntimeUtil.primitiveToBox.entrySet() )
beanInfoMap.put( e.getKey(), beanInfoMap.get(e.getValue()) );
// build bridges
ReflectionNavigator nav = typeSet.getNavigator();
for (TypeReference tr : typeRefs) {
XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class);
Adapter<Type,Class> a=null;
XmlList xl = tr.get(XmlList.class);