public void put(Name name, V value ) { put(name.nsUri,name.localName,value); }
public void put(QName name, V value ) { put(name.getNamespaceURI(),name.getLocalPart(),value); }
private int allocIndex(QNameMap<Integer> map, String nsUri, String localName) { Integer i = map.get(nsUri,localName); if(i==null) { i = map.size(); map.put(nsUri,localName,i); } return i; }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { keyLoader = keyBeanInfo.getLoader(chain.context,true); valueLoader = valueBeanInfo.getLoader(chain.context,true); handlers.put(tagName,new ChildLoader(itemsLoader,null)); }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { Loader l = new LeafPropertyLoader(xacc); l = new DefaultValueLoaderDecorator(l, defaultValue); handlers.put(tagName, new ChildLoader(l,null)); }
public void buildChildElementUnmarshallers(UnmarshallerChain chainElem, QNameMap<ChildLoader> handlers) { handlers.put(StructureLoaderBuilder.TEXT_HANDLER, new ChildLoader(new ValuePropertyLoader(xacc),null)); }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet()) handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc)); if(domHandler!=null) handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc)); }
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) { final int offset = chain.allocateOffset(); Receiver recv = new ReceiverImpl(offset); for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) { final JaxBeanInfo beanInfo = n.getValue(); loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv)); } if(isMixed) { // handler for processing mixed contents. loaders.put(TEXT_HANDLER, new ChildLoader(new MixedTextLoader(recv),null)); } if(domHandler!=null) { loaders.put(CATCH_ALL, new ChildLoader(new WildcardLoader(domHandler,wcMode),recv)); } }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { Loader l = new LeafPropertyLoader(xacc); if (defaultValue != null) l = new DefaultValueLoaderDecorator(l, defaultValue); if (nillable || chain.context.allNillable) l = new XsiNilLoader.Single(l, acc); // LeafPropertyXsiLoader doesn't work well with nillable elements if (improvedXsiTypeHandling) l = new LeafPropertyXsiLoader(l, xacc, acc); handlers.put(tagName, new ChildLoader(l, null)); }
/** * Copies all of the mappings from the specified map to this map * These mappings will replace any mappings that * this map had for any of the keys currently in the specified map. * * @param map mappings to be stored in this map. * */ public QNameMap<V> putAll(QNameMap<? extends V> map) { int numKeysToBeAdded = map.size(); if (numKeysToBeAdded == 0) return this; if (numKeysToBeAdded > threshold) { int targetCapacity = numKeysToBeAdded; if (targetCapacity > MAXIMUM_CAPACITY) targetCapacity = MAXIMUM_CAPACITY; int newCapacity = table.length; while (newCapacity < targetCapacity) newCapacity <<= 1; if (newCapacity > table.length) resize(newCapacity); } for( Entry<? extends V> e : map.entrySet() ) put(e.nsUri,e.localName,e.getValue()); return this; }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { JAXBContextImpl context = chain.context; for (TypeRef<Type,Class> e : prop.getTypes()) { JaxBeanInfo bi = context.getOrCreate((RuntimeTypeInfo) e.getTarget()); // if the expected Java type is already final, type substitution won't really work anyway. // this also traps cases like trying to substitute xsd:long element with xsi:type='xsd:int' Loader l = bi.getLoader(context,!Modifier.isFinal(bi.jaxbType.getModifiers())); if(e.getDefaultValue()!=null) l = new DefaultValueLoaderDecorator(l,e.getDefaultValue()); if(nillable || chain.context.allNillable) l = new XsiNilLoader.Single(l,acc); handlers.put( e.getTagName(), new ChildLoader(l,acc)); } }
public ArrayReferenceNodeProperty(JAXBContextImpl p, RuntimeReferencePropertyInfo prop) { super(p, prop, prop.getXmlName(), prop.isCollectionNillable()); for (RuntimeElement e : prop.getElements()) { JaxBeanInfo bi = p.getOrCreate(e); expectedElements.put( e.getElementName().getNamespaceURI(),e.getElementName().getLocalPart(), bi ); } isMixed = prop.isMixed(); if(prop.getWildcard()!=null) { domHandler = (DomHandler) ClassFactory.create(prop.getDOMHandler()); wcMode = prop.getWildcard(); } else { domHandler = null; wcMode = null; } }
public final void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) { if(wrapperTagName!=null) { UnmarshallerChain c = new UnmarshallerChain(chain.context); QNameMap<ChildLoader> m = new QNameMap<ChildLoader>(); createBodyUnmarshaller(c,m); Loader loader = new ItemsLoader(acc, lister, m); if(isWrapperNillable || chain.context.allNillable) loader = new XsiNilLoader(loader); loaders.put(wrapperTagName,new ChildLoader(loader,null)); } else { createBodyUnmarshaller(chain,loaders); } }
public SingleReferenceNodeProperty(JAXBContextImpl context, RuntimeReferencePropertyInfo prop) { super(context,prop); acc = prop.getAccessor().optimize(context); for (RuntimeElement e : prop.getElements()) { expectedElements.put( e.getElementName(), context.getOrCreate(e) ); } if(prop.getWildcard()!=null) { domHandler = (DomHandler) ClassFactory.create(prop.getDOMHandler()); wcMode = prop.getWildcard(); } else { domHandler = null; wcMode = null; } }
attUnmarshallers = new QNameMap<TransducedAccessor>(); AttributeProperty ap = (AttributeProperty) p; attUnmarshallers.put(ap.attName.toQName(),ap.xacc); break; case ELEMENT:
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) { // all items go to the same lister, // so they should share the same offset. int offset = chain.allocateOffset(); Receiver recv = new ReceiverImpl(offset); for (RuntimeTypeRef typeRef : prop.getTypes()) { Name tagName = chain.context.nameBuilder.createElementName(typeRef.getTagName()); Loader item = createItemUnmarshaller(chain,typeRef); if(typeRef.isNillable() || chain.context.allNillable) item = new XsiNilLoader.Array(item); if(typeRef.getDefaultValue()!=null) item = new DefaultValueLoaderDecorator(item,typeRef.getDefaultValue()); loaders.put(tagName,new ChildLoader(item,recv)); } }
private int allocIndex(QNameMap<Integer> map, String nsUri, String localName) { Integer i = map.get(nsUri,localName); if(i==null) { i = map.size(); map.put(nsUri,localName,i); } return i; }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { keyLoader = keyBeanInfo.getLoader(chain.context,true); valueLoader = valueBeanInfo.getLoader(chain.context,true); handlers.put(tagName,new ChildLoader(itemsLoader,null)); }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet()) handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc)); if(domHandler!=null) handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc)); }