java.lang.Object
com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Definition
com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Scope
com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.DefaultScope
com.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
| Fields inherited from class com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Definition |
|
| Methods inherited from class com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.Definition |
addReference, compareTo, getEnclosingPackage, getName, getNumReferences, getOccurrence, getParentScope, getQualifiedName, getReferences, getTreeNode, isSourced, toString |
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
ClassDef
public ClassDef(java.lang.String name,
Scope parentScope,
SymTabAST node)
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()