/** * Create a new instance of JAXBHelperContext * @param aJAXBContext - The JAXBContext representing the class to XML schema mapping. * @param aClassLoader - The ClassLoader containing the generated SDO classes/interfaces (if any). */ public JAXBHelperContext(JAXBContext aJAXBContext, ClassLoader aClassLoader) { super(aClassLoader); wrapperDataObjects = new IdentityWeakHashMap<Object, SDODataObject>(); jaxbContext = (org.eclipse.persistence.jaxb.JAXBContext) aJAXBContext; }
/** * @return the size of this <tt>IdentityWeakHashMap</tt>. */ public int size() { cleanUp(); return count; }
public void clear() { IdentityWeakHashMap.this.clear(); } };
/** * Copies all of the mappings from the given map to this * <tt>IdentityWeakHashMap</tt>, replacing any existing mappings. * * @param m mappings to be stored in this <tt>IdentityWeakHashMap</tt>. * @throws <tt>NullPointerException</tt> if m is null. */ public void putAll(Map<? extends K, ? extends V> m) { if (m == null) { throw new NullPointerException(); } Iterator<? extends Entry<? extends K, ? extends V>> i = m.entrySet().iterator(); while (i.hasNext()) { Map.Entry<? extends K, ? extends V> me = i.next(); put(me.getKey(), me.getValue()); } }
/** * Constructs a new <tt>IdentityWeakHashMap</tt> with the same mappings * as the given map. The <tt>IdentityWeakHashMap</tt> is created with a * capacity sufficient to hold the elements of the given map. * * @param m the map whose mappings are to be placed in the * <tt>IdentityWeakHashMap</tt>. */ public IdentityWeakHashMap(Map m) { this(Math.max((int)(m.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); putAll(m); }
/** * This method is used internally to clone a map that holds the persistenceContexts. A weak map is returned if ReferenceMode is weak. * */ protected Map cloneMap(Map map){ // bug 270413. This method is needed to avoid the class cast exception when the reference mode is weak. if (this.referenceMode != null && this.referenceMode != ReferenceMode.HARD) return (IdentityWeakHashMap)((IdentityWeakHashMap)map).clone(); return (IdentityHashMap)((IdentityHashMap)map).clone(); }
public boolean contains(Object o) { return containsKey(o); }
public boolean remove(Object o) { int oldSize = count; IdentityWeakHashMap.this.remove(o); return count != oldSize; }
public boolean contains(Object o) { return containsValue(o); }
/** * Copies all of the mappings from the given map to this * <tt>IdentityWeakHashMap</tt>, replacing any existing mappings. * * @param m mappings to be stored in this <tt>IdentityWeakHashMap</tt>. * @throws <tt>NullPointerException</tt> if m is null. */ public void putAll(Map<? extends K, ? extends V> m) { if (m == null) { throw new NullPointerException(); } Iterator<? extends Entry<? extends K, ? extends V>> i = m.entrySet().iterator(); while (i.hasNext()) { Map.Entry<? extends K, ? extends V> me = i.next(); put(me.getKey(), me.getValue()); } }
/** * Constructs a new <tt>IdentityWeakHashMap</tt> with the same mappings * as the given map. The <tt>IdentityWeakHashMap</tt> is created with a * capacity sufficient to hold the elements of the given map. * * @param m the map whose mappings are to be placed in the * <tt>IdentityWeakHashMap</tt>. */ public IdentityWeakHashMap(Map m) { this(Math.max((int)(m.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); putAll(m); }
/** * This method is used internally to clone a map that holds the persistenceContexts. A weak map is returned if ReferenceMode is weak. * */ protected Map cloneMap(Map map){ // bug 270413. This method is needed to avoid the class cast exception when the reference mode is weak. if (this.referenceMode != null && this.referenceMode != ReferenceMode.HARD) return (IdentityWeakHashMap)((IdentityWeakHashMap)map).clone(); return (IdentityHashMap)((IdentityHashMap)map).clone(); }
public boolean contains(Object o) { return containsKey(o); }
public boolean remove(Object o) { int oldSize = count; IdentityWeakHashMap.this.remove(o); return count != oldSize; }
public boolean contains(Object o) { return containsValue(o); }
/** * @return the size of this <tt>IdentityWeakHashMap</tt>. */ public int size() { cleanUp(); return count; }
/** * Create a new instance of JAXBHelperContext * @param aJAXBContext - The JAXBContext representing the class to XML schema mapping. * @param aClassLoader - The ClassLoader containing the generated SDO classes/interfaces (if any). */ public JAXBHelperContext(JAXBContext aJAXBContext, ClassLoader aClassLoader) { super(aClassLoader); wrapperDataObjects = new IdentityWeakHashMap<Object, SDODataObject>(); jaxbContext = (org.eclipse.persistence.jaxb.JAXBContext) aJAXBContext; }