com.avaje.ebean.bean
Class NodeUsageCollector

java.lang.Object
  extended by com.avaje.ebean.bean.NodeUsageCollector

public final class NodeUsageCollector
extends Object

Collects profile information for a bean (or reference/proxy bean) at a given AutoFetchNode.

The AutoFetchNode identifies the location of the bean in the object graph.

It has to use a weak reference so as to ensure that it does not stop the associated bean from being garbage collected.


Constructor Summary
NodeUsageCollector(ObjectGraphNode node, WeakReference<NodeUsageListener> managerRef)
           
 
Method Summary
 void addUsed(String property)
          Add the name of a property that has been used.
 String getLoadProperty()
           
 ObjectGraphNode getNode()
          Return the associated node which identifies the location in the object graph of the bean/reference.
 HashSet<String> getUsed()
          Return the set of used properties.
 boolean isEmpty()
          Return true if no properties where used.
 boolean isModified()
          Return true if the bean was modified by a setter.
 void setLoadProperty(String loadProperty)
          The property that invoked a lazy load.
 void setModified()
          The bean has been modified by a setter method.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeUsageCollector

public NodeUsageCollector(ObjectGraphNode node,
                          WeakReference<NodeUsageListener> managerRef)
Method Detail

setModified

public void setModified()
The bean has been modified by a setter method.


addUsed

public void addUsed(String property)
Add the name of a property that has been used.


setLoadProperty

public void setLoadProperty(String loadProperty)
The property that invoked a lazy load.


getNode

public ObjectGraphNode getNode()
Return the associated node which identifies the location in the object graph of the bean/reference.


isEmpty

public boolean isEmpty()
Return true if no properties where used.


getUsed

public HashSet<String> getUsed()
Return the set of used properties.


isModified

public boolean isModified()
Return true if the bean was modified by a setter.


getLoadProperty

public String getLoadProperty()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.