edu.rit.classfile
Class ClassDescription

java.lang.Object
  extended by edu.rit.classfile.TypeReference
      extended by edu.rit.classfile.ArrayOrClassReference
          extended by edu.rit.classfile.ClassReference
              extended by edu.rit.classfile.ClassDescription
Direct Known Subclasses:
SynthesizedClassOrInterfaceDescription

public abstract class ClassDescription
extends ClassReference

Class ClassDescription encapsulates the information needed both to refer to and to describe a class or interface. This includes the class's fully-qualified name, superclass, superinterfaces, access flags, fields, and subroutines (methods, constructors, and class initializer). In the documentation below, the term "described class" means "the class or interface described by this class description object."


Method Summary
 List getFields()
          Returns a list of the described class's fields.
 List getSubroutines()
          Returns a list of the described class's subroutines (methods, constructors, and class initializers).
 ClassReference getSuperclass()
          Returns the described class's superclass.
 List getSuperinterfaces()
          Returns a list of the described class's superinterfaces.
 boolean isAbstract()
          Returns true if the described class is abstract, that is, cannot be directly instantiated.
 boolean isFinal()
          Returns true if the described class is final, that is, cannot be subclassed.
 boolean isInterface()
          Returns true if the described class is an interface.
 boolean isPublic()
          Returns true if the described class is public, that is, can be accessed from outside its package.
 
Methods inherited from class edu.rit.classfile.ClassReference
getClassName, getSimpleName
 
Methods inherited from class edu.rit.classfile.ArrayOrClassReference
getClassInternalName
 
Methods inherited from class edu.rit.classfile.TypeReference
equals, getTypeDescriptor, getWordCount, hashCode, read, toString, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

isPublic

public boolean isPublic()
Returns true if the described class is public, that is, can be accessed from outside its package.


isFinal

public boolean isFinal()
Returns true if the described class is final, that is, cannot be subclassed.


isInterface

public boolean isInterface()
Returns true if the described class is an interface.


isAbstract

public boolean isAbstract()
Returns true if the described class is abstract, that is, cannot be directly instantiated.


getSuperclass

public ClassReference getSuperclass()
Returns the described class's superclass.


getSuperinterfaces

public List getSuperinterfaces()
Returns a list of the described class's superinterfaces. In the case of a class, the superinterfaces are the interfaces the described class implements; in the case of an interface, the superinterfaces are the interfaces the described interface extends. The returned list is unmodifiable. Each item in the list is an instance of class ClassReference. The superinterfaces appear in the list in the order they were declared. If there are no superinterfaces, the returned list's size is zero.


getFields

public List getFields()
Returns a list of the described class's fields. The returned list is unmodifiable. Each item in the list is an instance of class FieldDescription. The fields appear in the list in the order they were declared. If there are no fields, the returned list's size is zero.


getSubroutines

public List getSubroutines()
Returns a list of the described class's subroutines (methods, constructors, and class initializers). The returned list is unmodifiable. Each item in the list is an instance of class SubroutineDescription. The subroutines appear in the list in the order they were declared. If there are no subroutines, the returned list's size is zero.



Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.