/** * Returns the set of valid root tag names. * For diagnostic use. */ public Set<QName> getValidRootNames() { Set<QName> r = new TreeSet<QName>(QNAME_COMPARATOR); for (QNameMap.Entry e : rootMap.entrySet()) { r.add(e.createQName()); } return r; }
@Override public boolean equals(Object o) { if (!(o instanceof Entry)) return false; Entry e = (Entry)o; String k1 = nsUri; String k2 = e.nsUri; String k3 = localName; String k4 = e.localName; if (k1 == k2 || (k1 != null && k1.equals(k2)) && (k3 == k4 ||(k3 !=null && k3.equals(k4)))) { Object v1 = getValue(); Object v2 = e.getValue(); if (v1 == v2 || (v1 != null && v1.equals(v2))) return true; } return false; }
/** * 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; }
/** * 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 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)); } }
@Override public boolean equals(Object o) { if (!(o instanceof Entry)) return false; Entry e = (Entry)o; String k1 = nsUri; String k2 = e.nsUri; String k3 = localName; String k4 = e.localName; if (k1 == k2 || (k1 != null && k1.equals(k2)) && (k3 == k4 ||(k3 !=null && k3.equals(k4)))) { Object v1 = getValue(); Object v2 = e.getValue(); if (v1 == v2 || (v1 != null && v1.equals(v2))) return true; } return false; }
@Override public boolean equals(Object o) { if (!(o instanceof Entry)) return false; Entry e = (Entry)o; String k1 = nsUri; String k2 = e.nsUri; String k3 = localName; String k4 = e.localName; if (k1 == k2 || (k1 != null && k1.equals(k2)) && (k3 == k4 ||(k3 !=null && k3.equals(k4)))) { Object v1 = getValue(); Object v2 = e.getValue(); if (v1 == v2 || (v1 != null && v1.equals(v2))) return true; } return false; }
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) { if(loader==null) { // this has to be done lazily to avoid cyclic reference issue UnmarshallerChain c = new UnmarshallerChain(context); QNameMap<ChildLoader> result = new QNameMap<ChildLoader>(); property.buildChildElementUnmarshallers(c,result); if(result.size()==1) // for ElementBeanInfoImpl created from RuntimeElementInfo this.loader = new IntercepterLoader(result.getOne().getValue().loader); else // for special ElementBeanInfoImpl only used for marshalling this.loader = Discarder.INSTANCE; } return loader; }
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 Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) { if(loader==null) { // this has to be done lazily to avoid cyclic reference issue UnmarshallerChain c = new UnmarshallerChain(context); QNameMap<ChildLoader> result = new QNameMap<ChildLoader>(); property.buildChildElementUnmarshallers(c,result); if(result.size()==1) // for ElementBeanInfoImpl created from RuntimeElementInfo this.loader = new IntercepterLoader(result.getOne().getValue().loader); else // for special ElementBeanInfoImpl only used for marshalling this.loader = Discarder.INSTANCE; } return loader; }
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)); }
/** * Returns the set of valid root tag names. * For diagnostic use. */ public Set<QName> getValidRootNames() { Set<QName> r = new TreeSet<QName>(QNAME_COMPARATOR); for (QNameMap.Entry e : rootMap.entrySet()) { r.add(e.createQName()); } return r; }
/** * Add a new entry with the specified keys, value and hash code to * the specified bucket. It is the responsibility of this * method to resize the table if appropriate. * */ private void addEntry(int hash, String nsUri, String localName, V value, int bucketIndex) { Entry<V> e = table[bucketIndex]; table[bucketIndex] = new Entry<V>(hash, nsUri, localName, value, e); if (size++ >= threshold) resize(2 * table.length); }
public Collection<QName> keySet() { Set<QName> r = new HashSet<QName>(); for (Entry<V> e : entrySet()) { r.add(e.createQName()); } return r; }
@Override public String toString() { return '"'+nsUri +"\",\"" +localName + "\"=" + getValue(); } }
@Override public String toString() { return '"'+nsUri +"\",\"" +localName + "\"=" + getValue(); } }
/** * Returns the set of valid root tag names. * For diagnostic use. */ public Set<QName> getValidRootNames() { Set<QName> r = new TreeSet<QName>(QNAME_COMPARATOR); for (QNameMap.Entry e : rootMap.entrySet()) { r.add(e.createQName()); } return r; }
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)); }
/** * Add a new entry with the specified keys, value and hash code to * the specified bucket. It is the responsibility of this * method to resize the table if appropriate. * */ private void addEntry(int hash, String nsUri, String localName, V value, int bucketIndex) { Entry<V> e = table[bucketIndex]; table[bucketIndex] = new Entry<V>(hash, nsUri, localName, value, e); if (size++ >= threshold) resize(2 * table.length); }
public Collection<QName> keySet() { Set<QName> r = new HashSet<QName>(); for (Entry<V> e : entrySet()) { r.add(e.createQName()); } return r; }