|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object th.co.edge.jseq.ConstructorFilter
public class ConstructorFilter
A Filter
that accepts all methods, except constructors that
are either synthetic (automatically created by the compiler), or are calls to
super
.
The reason that this filter was created was to remove "unnecessary" calls to
<init>
from the sequence diagrams. Since the sequence
diagrams generated by JSeq are class-based, not instance-based (i.e., each
lifeline belongs to a class, not to a specific instance), and since the class
of the instance being called is used (not the declaring class), calls to
synthetic constructors or to the super constructor would be represented as
one or several calls to <init>
back to the same class.
This was deemed more confusing than helpful.
In order to determine if a call is a call to a super-class constructor, this
filter needs access to a ClassLoader
. When running JSeq
stand-alone, this is not a problem, but when attaching to a running process,
JSeq should have the same classpath as that process. If not, the only effect
is that the "unnecessary" constructor calls are included in the diagram, so
failure to set up the correct classpath when attaching to a process is far
from catastrophic.
This filter was created after Jacek Ratzinger supplied his patch (SourceForge issue 2027500) since that change made calls to the super-class constructor look as calls back to the same class. In the process it also turned out that private nested classes use a synthetic constructor that need not be shown in the generated sequence diagrams.
Constructor Summary | |
---|---|
ConstructorFilter(java.lang.ClassLoader classLoader)
Creates a new ConstructorFilter that uses the given
ClassLoader to determine if a call is to a super-class
constructor. |
Method Summary | |
---|---|
boolean |
accept(Activation activation)
Returns true for all Activation s, except
calls to synthetic constructors and calls to super-class constructors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstructorFilter(java.lang.ClassLoader classLoader)
ConstructorFilter
that uses the given
ClassLoader
to determine if a call is to a super-class
constructor.
classLoader
- a ClassLoader
that should match that of the
process being tracedMethod Detail |
---|
public boolean accept(Activation activation)
true
for all Activation
s, except
calls to synthetic constructors and calls to super-class constructors.
accept
in interface ActivationList.Filter
activation
- the Activation
to check
false
if activation
represents a
call to a synthetic constructor or a call to a super-class
constructor, true
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |