net.mtu.eggplant.dbc
Class AssertClass

java.lang.Object
  extended bynet.mtu.eggplant.dbc.AssertClass
All Implemented Interfaces:
net.mtu.eggplant.util.Named

public class AssertClass
extends Object
implements net.mtu.eggplant.util.Named

Object to represent an instrumented class.

Version:
$Revision: 1.4 $

Constructor Summary
AssertClass(String name, String packageName, boolean isInterface, AssertClass enclosingClass, boolean isAnonymous, String superclass, List interfaces, Map imports, Set starImports)
          If packageName is null, then it's in the default package.
 
Method Summary
 void addMethod(AssertMethod am)
          Adds this method to the list of methods defined on this class.
 String createAnonymousClassName()
          Create the name for the next anonymous class that is defined inside this class.
 String createDummyConstructorClassName()
          Create the name for a dummy class for the next constructors pre conditions.
 AssertClass getEnclosingClass()
           
 String getFullName()
           
 Map getImports()
          The Map of imports from the file this class is defined in.
 List getInterfaces()
          The List of interfaces implemented/extended by this class/interface, in the order that they are declared on the implements line.
 List getInvariants()
          List of invariants for this class, ordered as they appear in the code.
 Set getMethods()
           
 String getName()
           
 String getPackage()
           
 Set getStarImports()
          The Set of star imports from the file this class is defined in.
 String getSuperclass()
           
 boolean isAnonymous()
           
 boolean isInterface()
           
 void setInvariants(List invariants)
          List of invariants for this class, ordered as they appear in the code.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssertClass

public AssertClass(String name,
                   String packageName,
                   boolean isInterface,
                   AssertClass enclosingClass,
                   boolean isAnonymous,
                   String superclass,
                   List interfaces,
                   Map imports,
                   Set starImports)
If packageName is null, then it's in the default package. If name is null, it's an anonomous class.

Parameters:
name - the simple name of this class
packageName - the name of hte package this class is in
isInterface - true if this class represents an interface
enclosingClass - the enclosing class, this can not be another anonymous class, null if this is the outermost class
isAnonymous - true if this class represents an anonymous class
superclass - name of the superclass, null if none listed in the .java file
interfaces - list of interfaces implemented, this is where the list of extended interfaces appear if this object represents an interface itself. These names may not be fully qualified. They should be checked against the imports list.
imports - map of imports for this class key = package, value = class/null
starImports - Set of star imports
PreConditions
(interfaces != null), (imports != null), (enclosingClass == null || !enclosingClass.isAnonymous)
Method Detail

getInterfaces

public final List getInterfaces()
The List of interfaces implemented/extended by this class/interface, in the order that they are declared on the implements line.


getImports

public final Map getImports()
The Map of imports from the file this class is defined in. key = package, value = class.


getStarImports

public final Set getStarImports()
The Set of star imports from the file this class is defined in.


getSuperclass

public final String getSuperclass()

getEnclosingClass

public final AssertClass getEnclosingClass()

isAnonymous

public final boolean isAnonymous()

isInterface

public final boolean isInterface()

getName

public final String getName()
Specified by:
getName in interface net.mtu.eggplant.util.Named

getFullName

public final String getFullName()
Returns:
the fully qualified name of this class object

getPackage

public final String getPackage()

addMethod

public final void addMethod(AssertMethod am)
Adds this method to the list of methods defined on this class.


getMethods

public final Set getMethods()

toString

public String toString()

setInvariants

public final void setInvariants(List invariants)
List of invariants for this class, ordered as they appear in the code.

PreConditions
(invariants != null)

getInvariants

public final List getInvariants()
List of invariants for this class, ordered as they appear in the code.


createAnonymousClassName

public final String createAnonymousClassName()
Create the name for the next anonymous class that is defined inside this class.


createDummyConstructorClassName

public final String createDummyConstructorClassName()
Create the name for a dummy class for the next constructors pre conditions.