Examples of IdentityHashMap


Examples of java.util.IdentityHashMap

    private static Object recursionCheck = new Object();

    public CopyState(TypeRepository rep) {
        this.rep = rep;
        this.copied = new IdentityHashMap();
        this.recursionResolverMap = new IdentityHashMap();
    }
View Full Code Here

Examples of java.util.IdentityHashMap

     * Create a new BeanValidationContext instance.
     * @param listener
     */
    @SuppressWarnings("unchecked")
    public BeanValidationContext(T listener) {
        this(listener, new IdentityHashMap());
    }
View Full Code Here

Examples of java.util.IdentityHashMap

    /**
     * @see org.apache.derby.iapi.sql.conn.LanguageConnectionContext#getPrintedObjectsMap
     */
    public Map getPrintedObjectsMap() {
        if (printedObjectsMap == null) {
            printedObjectsMap = new IdentityHashMap();
        }
        return printedObjectsMap;
    }
View Full Code Here

Examples of java.util.IdentityHashMap

    public DependencyTreeResolutionListener( Logger logger )
    {
        this.logger = logger;

        parentNodes = new Stack();
        nodesByArtifact = new IdentityHashMap();
        rootNode = null;
        currentNode = null;
    }
View Full Code Here

Examples of java.util.IdentityHashMap

  /**
   * Returns a new non-threadsafe context map.
   */
  public static Map newContext() {
    return new IdentityHashMap();
  }
View Full Code Here

Examples of java.util.IdentityHashMap

        }
        else if (source == destination) {
            return;
        }
        else {
            this.localIdentityMap.set(new IdentityHashMap());
            this.doMerge(source, destination);
        }
    }
View Full Code Here

Examples of java.util.IdentityHashMap

        }
    }
   
    private void cascadeMerge(Object source, Object destination) {
        // We are traversing the source object graph, and we'll have to put in an identity map the source object.
        IdentityHashMap localIdentityMap = (IdentityHashMap) DefaultIdMerger.localIdentityMap.get();
        if (! localIdentityMap.containsKey(source)) {
            localIdentityMap.put(source, new Integer(1));
            this.doCascadeMerge(source, destination);
        }
    }
View Full Code Here

Examples of java.util.IdentityHashMap

    public DefaultPrevalentSystem() {
        this.merger.setPrevalenceInfo(this.prevalenceInfo);
    }
   
    public Object save(Object newEntity) {
        this.localIdentityMap.set(new IdentityHashMap());
        this.internalSave(newEntity);
        return newEntity;
    }
View Full Code Here

Examples of java.util.IdentityHashMap

    public Object update(Object entity) {
        Object id = null;
        try {
            id = this.prevalenceInfo.getIdResolutionStrategy().resolveId(entity).get(entity);
            if (id != null) {
                this.localIdentityMap.set(new IdentityHashMap());
                this.internalUpdate(entity, id);
                return entity;
            } else {
                throw new PrevaylerUnsavedObjectException("Cannot update unsaved object!");
            }
View Full Code Here

Examples of java.util.IdentityHashMap

            Map entityMap = this.lookupMap(newEntity.getClass());
            // Assign id:
            id = this.prevalenceInfo.getIdGenerationStrategy().generateId();
            this.prevalenceInfo.getIdResolutionStrategy().resolveId(newEntity).set(newEntity, id);
            // Add the entity to the thread local identity map, for tracking its traversal (an entity once traversed must not be tarversed again):
            IdentityHashMap localIdentityMap = (IdentityHashMap) DefaultPrevalentSystem.localIdentityMap.get();
            localIdentityMap.put(newEntity, new Integer(1));
            // Add the new entity to the system:
            entityMap.put(id, newEntity);
            // Self cascade persistence (needed for updating pointers to already persisted entities):
            this.doCascadePersistence(newEntity, newEntity);
            // Return the new, updated and saved, entity:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.