Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.checks.usage.transmogrify
Class ClassDef  view ClassDef download ClassDef.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Definition
      extended bycom.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Scope
          extended bycom.puppycrawl.tools.checkstyle.checks.usage.transmogrify.DefaultScope
              extended bycom.puppycrawl.tools.checkstyle.checks.usage.transmogrify.ClassDef
All Implemented Interfaces:
java.lang.Comparable, IClass, IDefinition
Direct Known Subclasses:
AnonymousInnerClass

public class ClassDef
extends DefaultScope
implements IClass

ClassDef contains all the information needed to represent a java class or interface. This includes the superclass, whether it's a class or an interface, the interfaces it implements, a list of its (direct?) subclasses, and the classes that implement it if it is an interface


Field Summary
protected  MethodDef _defaultConstructor
           
private  long id
           
private  java.util.List implementors
           
private  java.util.Set importedPackages
           
private  java.util.Hashtable imports
           
private  java.util.List interfaces
           
private  java.util.Set methods
           
private  java.util.List subclasses
           
private  IClass superclass
           
private  java.util.Vector unprocessedImports
           
 
Fields inherited from class com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Scope
classes, elements, labels, referencesInScope
 
Fields inherited from class com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Definition
 
Constructor Summary
ClassDef(java.lang.String name, Scope parentScope, SymTabAST node)
           
 
Method Summary
 void addDefinition(MethodDef method)
           
 void addImplementor(ClassDef implementor)
          adds ClassDef to the collection of implemented interfaces of this class
 void addInterface(IClass implemented)
           
 void addSubclass(ClassDef subclass)
          adds ClassDef to the collection of (direct?) subclasses of this class
 void addUnprocessedImports(java.util.Vector imports)
           
 IClass getClassDefinition(java.lang.String name)
          gets class definition referenced by this class, including its inner classes, imported classes, packages, and its parent scope referenced class definitions
 IMethod getDeclaredMethod(java.lang.String name, ISignature signature)
           
protected  java.util.Enumeration getDefinitions()
           
 ClassDef getEnclosingClass()
          Returns the ClassDef that this scope is contained in.
 java.util.List getImplementors()
          gets the list of ClassDefs that implmement this interface
 IClass[] getInnerClasses()
          gets inner classes definition associated with this class
 IClass[] getInterfaces()
          gets interfaces definition implemented by this class definition
 IMethod getMethodDefinition(java.lang.String name, ISignature signature)
          gets the method associated with the given name and signature
 IMethod getMostCompatibleMethod(java.lang.String name, ISignature signature)
           
 long getNextAnonymousId()
           
private  SymTabAST getObjblock()
           
 java.util.List getSubclasses()
          gets subclasses definition of this class definition
 IClass getSuperclass()
          gets superclass definition of this class
 java.util.Vector getUnprocessedImports()
           
 IVariable getVariableDefinition(java.lang.String name)
          gets the VariableDef associated with the given name
 void importClass(IClass imported)
           
 void importPackage(IPackage pkg)
           
 boolean isCompatibleWith(IClass type)
          verifies if the input type is equal to this class or its superclass or its interfaces
 boolean isPrimitive()
          verifies if this class is of primitive Java type
 boolean isSuperclassOf(IClass possibleChild)
           
 void setSuperclass(IClass superclass)
           
 
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.DefaultScope
addDefinition, getLabelDefinition
 
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Scope
addDefinition, addDefinition, addDefinition, addDefinition, addReferenceInScope, getClasses, getReferencesIn, getSymbol
 
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Definition
addReference, compareTo, getEnclosingPackage, getName, getNumReferences, getOccurrence, getParentScope, getQualifiedName, getReferences, getTreeNode, isSourced, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.IDefinition
addReference, getName, getNumReferences, getQualifiedName, getReferences, isSourced
 

Field Detail

id

private long id

superclass

private IClass superclass

interfaces

private java.util.List interfaces

subclasses

private java.util.List subclasses

implementors

private java.util.List implementors

importedPackages

private java.util.Set importedPackages

methods

private java.util.Set methods

imports

private java.util.Hashtable imports

unprocessedImports

private java.util.Vector unprocessedImports

_defaultConstructor

protected MethodDef _defaultConstructor
Constructor Detail

ClassDef

public ClassDef(java.lang.String name,
                Scope parentScope,
                SymTabAST node)
Method Detail

getNextAnonymousId

public long getNextAnonymousId()

setSuperclass

public void setSuperclass(IClass superclass)

getSuperclass

public IClass getSuperclass()
Description copied from interface: IClass
gets superclass definition of this class

Specified by:
getSuperclass in interface IClass

addUnprocessedImports

public void addUnprocessedImports(java.util.Vector imports)

getUnprocessedImports

public java.util.Vector getUnprocessedImports()

importPackage

public void importPackage(IPackage pkg)

importClass

public void importClass(IClass imported)

addDefinition

public void addDefinition(MethodDef method)

getDefinitions

protected java.util.Enumeration getDefinitions()
Overrides:
getDefinitions in class Scope

getClassDefinition

public IClass getClassDefinition(java.lang.String name)
Description copied from interface: IClass
gets class definition referenced by this class, including its inner classes, imported classes, packages, and its parent scope referenced class definitions

Specified by:
getClassDefinition in interface IClass
Overrides:
getClassDefinition in class DefaultScope

getMethodDefinition

public IMethod getMethodDefinition(java.lang.String name,
                                   ISignature signature)
Description copied from interface: IClass
gets the method associated with the given name and signature

Specified by:
getMethodDefinition in interface IClass
Overrides:
getMethodDefinition in class DefaultScope

getMostCompatibleMethod

public IMethod getMostCompatibleMethod(java.lang.String name,
                                       ISignature signature)

getDeclaredMethod

public IMethod getDeclaredMethod(java.lang.String name,
                                 ISignature signature)

getVariableDefinition

public IVariable getVariableDefinition(java.lang.String name)
Description copied from interface: IClass
gets the VariableDef associated with the given name

Specified by:
getVariableDefinition in interface IClass
Overrides:
getVariableDefinition in class DefaultScope

addInterface

public void addInterface(IClass implemented)

getInterfaces

public IClass[] getInterfaces()
Description copied from interface: IClass
gets interfaces definition implemented by this class definition

Specified by:
getInterfaces in interface IClass

getEnclosingClass

public ClassDef getEnclosingClass()
Description copied from class: Definition
Returns the ClassDef that this scope is contained in.

Overrides:
getEnclosingClass in class Definition

addSubclass

public void addSubclass(ClassDef subclass)
Description copied from interface: IClass
adds ClassDef to the collection of (direct?) subclasses of this class

Specified by:
addSubclass in interface IClass

getSubclasses

public java.util.List getSubclasses()
Description copied from interface: IClass
gets subclasses definition of this class definition

Specified by:
getSubclasses in interface IClass

addImplementor

public void addImplementor(ClassDef implementor)
Description copied from interface: IClass
adds ClassDef to the collection of implemented interfaces of this class

Specified by:
addImplementor in interface IClass

getImplementors

public java.util.List getImplementors()
Description copied from interface: IClass
gets the list of ClassDefs that implmement this interface

Specified by:
getImplementors in interface IClass

getInnerClasses

public IClass[] getInnerClasses()
Description copied from interface: IClass
gets inner classes definition associated with this class

Specified by:
getInnerClasses in interface IClass

isSuperclassOf

public boolean isSuperclassOf(IClass possibleChild)

isCompatibleWith

public boolean isCompatibleWith(IClass type)
Description copied from interface: IClass
verifies if the input type is equal to this class or its superclass or its interfaces

Specified by:
isCompatibleWith in interface IClass

isPrimitive

public boolean isPrimitive()
Description copied from interface: IClass
verifies if this class is of primitive Java type

Specified by:
isPrimitive in interface IClass

getObjblock

private SymTabAST getObjblock()