Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## xjavadoc
Class AbstractClass

    java.lang.Object
      xjavadoc.AbstractProgramElement
          xjavadoc.AbstractClass

All Implemented Interfaces:
  Comparable, Named, XClass, XProgramElement, XType

Direct Known Subclasses:
  BinaryClass, Primitive, SourceClass, UnknownClass

public abstract class AbstractClass
extends AbstractProgramElement
implements XClass

Base implementation of XClass.

Author:
  Ara Abrahamian, Aslak Hellesøy

Field Summary

Fields inherited from class xjavadoc.AbstractProgramElement
`EMPTY_LIST`

Constructor Summary
`protected` | `AbstractClass(AbstractClass containingClass, XTagFactory tagFactory)`
`protected` | `AbstractClass(XJavaDoc xJavaDoc, XTagFactory tagFactory)`

Method Summary
`(package private) void` | `addConstructor(XConstructor constructor)` Gets the Constructors attribute of the AbstractClass object
`(package private) void` | `addField(XField field)` Gets the Fields attribute of the AbstractClass object
`(package private) void` | `addImportedClass(String importedClass)` Sets the ImportedClasses attribute of the AbstractClass object
`(package private) void` | `addImportedPackage(String importedPackage)` Sets the ImportedPackages attribute of the AbstractClass object
`protected void` | `addInnerClass(XClass clazz)`
`(package private) void` | `addInterface(String interfaceName)` Adds an interface that this class implements (if this is a class) or an interface that this interface extends (if this is an interface)
`(package private) void` | `addMethod(XMethod method)` Gets the Methods attribute of the AbstractClass object
`int` | `compareTo(Object o)`
`boolean` | `equals(Object obj)`
`List` | `getAllSubclasses()` Returns the (known) subclasses, regardless of how deep in the class hierarchy.
`XConstructor` | `getConstructor(String constructorNameWithSignature)` Gets the Constructor attribute of the AbstractClass object
`List` | `getConstructors()` Gets the constructors.
`XPackage` | `getContainingPackage()` Describe what the method does
`Collection` | `getDeclaredInterfaces()` Returns the interfaces that are declared in the source code.
`List` | `getDirectSubclasses()` Returns the (known) direct subclasses.
`List` | `getExtendingInterfaces()` Return the (known) interfaces that extend this interface.
`XField` | `getField(String fieldName)` Returns an XField with the given name.
`List` | `getFields()` Describe what the method does
`List` | `getFields(boolean superclasses)`
`List` | `getFields(Predicate predicate, boolean superclasses)`
`List` | `getImplementingClasses()` Return the (known) classes that implement this interface.
`List` | `getImportedClasses()` Describe what the method does
`List` | `getImportedPackages()` Describe what the method does
`List` | `getInnerClasses()` Describe what the method does
`List` | `getInterfaces()` Returns all the implemented interfaces (if this is a class) or all the extended interfaces (if this is an interface)
`XMethod` | `getMethod(String methodNameWithSignature)`
`XMethod` | `getMethod(String methodNameWithSignature, boolean superclasses)` Returns an XMethod with the given name and parameters.
`List` | `getMethods()` Returns all the methods, not including superclasses
`List` | `getMethods(boolean superclasses)` Returns all the methods.
`List` | `getMethods(Predicate predicate, boolean superclasses)` Returns all the methods that are accepted by the filter.
`List` | `getMethodTags(String tagName, boolean superclasses)` Returns a collection of tags from the methods in this class (or superclasses).
`String` | `getName()` Get name
`String` | `getQualifiedName()` Describe what the method does
`XClass` | `getSuperclass()` Describe what the method does
`XProgramElement` | `getSuperElement()` Describe what the method does
`List` | `getSuperInterfaceElements()`
`String` | `getTransformedName()` Gets the transformed class name, for example: `Character$Subset`
`String` | `getTransformedQualifiedName()` Gets the transformed qualified class name, for example: `java.lang.Character$Subset`
`String` | `getType()` Gets the type, e.g.
`int` | `hashCode()`
`protected boolean` | `hasImportedClasses()`
`protected boolean` | `hasImportedPackages()`
`protected boolean` | `hasInnerClasses()`
`boolean` | `isA(String full_qualified_type_name)` Returns true if we are subclass or implement the class/interface with the name classOrInterfaceName
`boolean` | `isA(String full_qualified_type_name, boolean superclasses)` Returns true if we are subclass or implement the class/interface with the name classOrInterfaceName
`boolean` | `isAnonymous()` Returns true if this class is anonymous.
`boolean` | `isImplementingInterface(String full_qualified_type_name)` Returns true if it implements full_qualified_type_name (or recursively superclasses implement).
`boolean` | `isImplementingInterface(String full_qualified_type_name, boolean superclasses)` Returns true if it implements full_qualified_type_name (or recursively superclasses implement, if superclasses==true).
`boolean` | `isInner()` Returns true if this is an inner class.
`boolean` | `isInterface()` Gets the Interface attribute of the SourceClass object
`boolean` | `isSubclassOf(String full_qualified_type_name)` Returns true if the superclass (or recursively superclass of superclass) is full_qualified_type_name.
`boolean` | `isSubclassOf(String full_qualified_type_name, boolean superclasses)` Returns true if the superclass (or recursively superclass of superclass, if superclasses==true) is full_qualified_type_name.
`long` | `lastModified()`
`XClass` | `qualify(String unqualifiedClassName)`
`(package private) void` | `reset()`
`(package private) void` | `resolveImportedClasses()`
`String` | `save(File rootDir)`
`(package private) void` | `setContainingPackage(String containingPackage)` Sets the ContainingPackage attribute of the AbstractProgramElement object Use package name specified in class, and do not complain about directory struct.
`(package private) void` | `setInterface(boolean flag)` Sets the Interface attribute of the SourceClass object
`(package private) void` | `setName(String name)` Sets the unqualified name of the class.
`(package private) void` | `setQualifiedName(String qualifiedName)` Sets the qualified name of the class.
`(package private) void` | `setRealised(String clazz)` This method is called for anonymous classes only.
`(package private) void` | `setSuperclass(String superclass)` Sets the SuperClass attribute of the SourceClass object
`String` | `toString()`
`void` | `updateDoc()` update javadoc

Methods inherited from class xjavadoc.AbstractProgramElement
`addModifier, getContainingAbstractClass, getContainingClass, getDoc, getModifiers, getModifierSpecifier, getTagFactory, getXJavaDoc, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, setToken`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface xjavadoc.XClass
`getContainingClass, isAbstract, isPrimitive, isWriteable, saveNeeded, setDirty`

Methods inherited from interface xjavadoc.XProgramElement
`getDoc, getModifiers, getModifierSpecifier, getXJavaDoc, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic`

Constructor Detail

### AbstractClass

    protected AbstractClass(AbstractClass containingClass,
                            XTagFactory tagFactory)

### AbstractClass

    protected AbstractClass(XJavaDoc xJavaDoc,
                            XTagFactory tagFactory)

Method Detail

### isInterface

    public final boolean isInterface()

  Gets the Interface attribute of the SourceClass object

  Specified by:
    `isInterface` in interface `XClass`
  Returns:
    The Interface value

### isA

    public final boolean isA(String full_qualified_type_name)

  Description copied from interface: `XClass`
  Returns true if we are subclass or implement the class/interface with the name classOrInterfaceName

  Specified by:
    `isA` in interface `XClass`
  Parameters:
    `full_qualified_type_name` - The full qualified type name
  Returns:
    true if of the specified type; false otherwise

### isA

    public final boolean isA(String full_qualified_type_name,
                             boolean superclasses)

  Description copied from interface: `XClass`
  Returns true if we are subclass or implement the class/interface with the name classOrInterfaceName

  Specified by:
    `isA` in interface `XClass`
  Parameters:
    `full_qualified_type_name` - The full qualified type name
    `superclasses` - whether the isA search should search the whole hierarchy
  Returns:
    true if of the specified type; false otherwise

### getMethod

    public final XMethod getMethod(String methodNameWithSignature)

  Specified by:
    `getMethod` in interface `XClass`
  Parameters:
    `methodNameWithSignature` -
  Returns:
    The XMethod if found, otherwise null

### getMethod

    public final XMethod getMethod(String methodNameWithSignature,
                                   boolean superclasses)

  Description copied from interface: `XClass`
  Returns an XMethod with the given name and parameters. Example: getMethod("hello",new String[]{"java.lang.String","int"});

  Specified by:
    `getMethod` in interface `XClass`
  Parameters:
    `methodNameWithSignature` - Describe what the parameter does
    `superclasses` - Looks in superclasses too if true
  Returns:
    The XMethod if found, otherwise null

### getConstructor

    public final XConstructor getConstructor(String constructorNameWithSignature)

  Gets the Constructor attribute of the AbstractClass object

  Specified by:
    `getConstructor` in interface `XClass`
  Parameters:
    `constructorNameWithSignature` - Describe what the parameter does
  Returns:
    The Constructor value

### getField

    public final XField getField(String fieldName)

  Returns an XField with the given name. Example: getField("id");

  Specified by:
    `getField` in interface `XClass`
  Parameters:
    `fieldName` - Describe what the parameter does
  Returns:
    The Field value

### getImportedClasses

    public final List getImportedClasses()

  Describe what the method does

  Specified by:
    `getImportedClasses` in interface `XClass`
  Returns:
    Describe the return value for method for return value

### getImportedPackages

    public final List getImportedPackages()

  Describe what the method does

  Specified by:
    `getImportedPackages` in interface `XClass`
  Returns:
    Describe the return value for method for return value

### getMethods

    public final List getMethods()

  Description copied from interface: `XClass`
  Returns all the methods, not including superclasses

  Specified by:
    `getMethods` in interface `XClass`
  Returns:
    A collection of XMethod objects

### getMethods

    public final List getMethods(Predicate predicate,
                                 boolean superclasses)

  Description copied from interface: `XClass`
  Returns all the methods that are accepted by the filter.

  Specified by:
    `getMethods` in interface `XClass`
  Parameters:
    `superclasses` - if true, include methods from superclasses too.
    `predicate` -
  Returns:
    A collection of XMethod objects

### getFields

    public final List getFields(Predicate predicate,
                                boolean superclasses)

### getMethods

    public final List getMethods(boolean superclasses)

  Description copied from interface: `XClass`
  Returns all the methods.

  Specified by:
    `getMethods` in interface `XClass`
  Parameters:
    `superclasses` - if true, include methods from superclasses and interfaces too.
  Returns:
    A collection of XMethod objects

### getFields

    public final List getFields(boolean superclasses)

  Specified by:
    `getFields` in interface `XClass`

### getFields

    public final List getFields()

  Describe what the method does

  Specified by:
    `getFields` in interface `XClass`
  Returns:
    Describe the return value for method for return value

### getConstructors

    public final List getConstructors()

  Gets the constructors.

  Specified by:
    `getConstructors` in interface `XClass`
  Returns:
    the constructors.

### isSubclassOf

    public final boolean isSubclassOf(String full_qualified_type_name)

  Description copied from interface: `XClass`
  Returns true if the superclass (or recursively superclass of superclass) is full_qualified_type_name.

  Specified by:
    `isSubclassOf` in interface `XClass`
  Parameters:
    `full_qualified_type_name` - Describe what the parameter does
  Returns:
    Describe the return value

### isImplementingInterface

    public final boolean isImplementingInterface(String full_qualified_type_name)

  Description copied from interface: `XClass`
  Returns true if it implements full_qualified_type_name (or recursively superclasses implement).

  Specified by:
    `isImplementingInterface` in interface `XClass`
  Parameters:
    `full_qualified_type_name` - Describe what the parameter does
  Returns:
    Describe the return value

### getType

    public String getType()

  Description copied from interface: `XClass`
  Gets the type, e.g. `java.lang.String.class` or `java.lang.Integer.TYPE` .

  Specified by:
    `getType` in interface `XClass`
  Returns:
    the qualified class name.

### isInner

    public boolean isInner()

  Description copied from interface: `XClass`
  Returns true if this is an inner class.

  Specified by:
    `isInner` in interface `XClass`
  Returns:
    true if this is an inner class.

### isSubclassOf

    public boolean isSubclassOf(String full_qualified_type_name,
                                boolean superclasses)

  Description copied from interface: `XClass`
  Returns true if the superclass (or recursively superclass of superclass, if superclasses==true) is full_qualified_type_name.

  Specified by:
    `isSubclassOf` in interface `XClass`
  Parameters:
    `full_qualified_type_name` - Describe what the parameter does
    `superclasses` - Looks in superclasses too if true
  Returns:
    Describe the return value

### isImplementingInterface

    public boolean isImplementingInterface(String full_qualified_type_name,
                                           boolean superclasses)

  Description copied from interface: `XClass`
  Returns true if it implements full_qualified_type_name (or recursively superclasses implement, if superclasses==true).

  Specified by:
    `isImplementingInterface` in interface `XClass`
  Parameters:
    `full_qualified_type_name` - Describe what the parameter does
    `superclasses` - Looks in superclasses too if true
  Returns:
    Describe the return value

### getName

    public String getName()

  Description copied from interface: `Named`
  Get name

  Specified by:
    `getName` in interface `Named`
  Returns:
    name

### getQualifiedName

    public String getQualifiedName()

  Describe what the method does

  Specified by:
    `getQualifiedName` in interface `XClass`
  Returns:
    Describe the return value for method for return value

### getTransformedName

    public String getTransformedName()

  Gets the transformed class name, for example: `Character$Subset`

  Specified by:
    `getTransformedName` in interface `XClass`
  Returns:
    the transformed class name.

### getTransformedQualifiedName

    public String getTransformedQualifiedName()

  Gets the transformed qualified class name, for example: `java.lang.Character$Subset`

  Specified by:
    `getTransformedQualifiedName` in interface `XClass`
  Returns:
    the transformed qualified class name.

### getInterfaces

    public List getInterfaces()

  Returns all the implemented interfaces (if this is a class) or all the extended interfaces (if this is an interface)

  Specified by:
    `getInterfaces` in interface `XClass`
  Returns:
    Describe the return value for method for return value

### getDeclaredInterfaces

    public Collection getDeclaredInterfaces()

  Returns the interfaces that are declared in the source code. This excludes any interfaces that might be implicitly implemented. This method is only useful for CodeUnit, which compares source codes, and should normally not be called.

  Returns:
    A Collection of XClass

### getSuperclass

    public XClass getSuperclass()

  Describe what the method does

  Specified by:
    `getSuperclass` in interface `XClass`
  Returns:
    Describe the return value for method for return value

### getDirectSubclasses

    public List getDirectSubclasses()

  Description copied from interface: `XClass`
  Returns the (known) direct subclasses. If this instance represents an interface, UnsupportedOperationException will be thrown. This can be avoided by testing with isInterface() prior to calling this method.

  Specified by:
    `getDirectSubclasses` in interface `XClass`
  Returns:
    the (known) subclasses

### getAllSubclasses

    public List getAllSubclasses()

  Description copied from interface: `XClass`
  Returns the (known) subclasses, regardless of how deep in the class hierarchy. If this instance represents an interface, UnsupportedOperationException will be thrown. This can be avoided by testing with isInterface() prior to calling this method.

  Specified by:
    `getAllSubclasses` in interface `XClass`
  Returns:
    the (known) subclasses

### getImplementingClasses

    public List getImplementingClasses()

  Description copied from interface: `XClass`
  Return the (known) classes that implement this interface. If this instance represents a class, an UnsupportedOperationException will be thrown. This can be avoided by testing with isInterface() prior to calling this method.

  Specified by:
    `getImplementingClasses` in interface `XClass`
  Returns:
    the (known) subinterfaces

### getExtendingInterfaces

    public List getExtendingInterfaces()

  Description copied from interface: `XClass`
  Return the (known) interfaces that extend this interface. If this instance represents a class, an UnsupportedOperationException will be thrown. This can be avoided by testing with isInterface() prior to calling this method.

  Specified by:
    `getExtendingInterfaces` in interface `XClass`
  Returns:
    the (known) extending interfaces

### getContainingPackage

    public XPackage getContainingPackage()

  Describe what the method does

  Specified by:
    `getContainingPackage` in interface `XClass`
  Overrides:
    `getContainingPackage` in class `AbstractProgramElement`
  Returns:
    Describe the return value

### getInnerClasses

    public List getInnerClasses()

  Describe what the method does

  Specified by:
    `getInnerClasses` in interface `XClass`
  Returns:
    Describe the return value

### getSuperElement

    public XProgramElement getSuperElement()

  Describe what the method does

  Specified by:
    `getSuperElement` in interface `XProgramElement`
  Returns:
    Describe the return value

### getSuperInterfaceElements

    public List getSuperInterfaceElements()

  Specified by:
    `getSuperInterfaceElements` in interface `XProgramElement`

### isAnonymous

    public boolean isAnonymous()

  Description copied from interface: `XClass`
  Returns true if this class is anonymous.

  Specified by:
    `isAnonymous` in interface `XClass`
  Returns:
    true if this class is anonymous.

### getMethodTags

    public List getMethodTags(String tagName,
                              boolean superclasses)

  Description copied from interface: `XClass`
  Returns a collection of tags from the methods in this class (or superclasses).

  Specified by:
    `getMethodTags` in interface `XClass`
  Parameters:
    `superclasses` -
    `tagName` -
  Returns:
    a List of `XTag`. If no tags are found, an empty List is returned.

### compareTo

    public final int compareTo(Object o)

  Specified by:
    `compareTo` in interface `Comparable`
  Overrides:
    `compareTo` in class `AbstractProgramElement`

### toString

    public final String toString()

### save

    public String save(File rootDir)
                throws IOException

  Specified by:
    `save` in interface `XClass`
  Throws:
    `IOException`

### equals

    public boolean equals(Object obj)

### hashCode

    public int hashCode()

### qualify

    public XClass qualify(String unqualifiedClassName)

  Specified by:
    `qualify` in interface `XClass`

### lastModified

    public long lastModified()

  Specified by:
    `lastModified` in interface `XClass`
  Returns:
    the time that this class was last modified

### updateDoc

    public void updateDoc()

  update javadoc

  Specified by:
    `updateDoc` in interface `XProgramElement`
  Overrides:
    `updateDoc` in class `AbstractProgramElement`

### hasImportedClasses

    protected final boolean hasImportedClasses()

### hasInnerClasses

    protected final boolean hasInnerClasses()

### hasImportedPackages

    protected final boolean hasImportedPackages()

### addInnerClass

    protected void addInnerClass(XClass clazz)

### setQualifiedName

    final void setQualifiedName(String qualifiedName)

  Sets the qualified name of the class. Should only be called on objects that represent outer classes.

  Parameters:
    `qualifiedName` - The new QualifiedName value

### setContainingPackage

    final void setContainingPackage(String containingPackage)

  Sets the ContainingPackage attribute of the AbstractProgramElement object Use package name specified in class, and do not complain about directory struct.

  Parameters:
    `containingPackage` - The new ContainingPackage value

### setInterface

    final void setInterface(boolean flag)

  Sets the Interface attribute of the SourceClass object

  Parameters:
    `flag` - The new Interface value

### setSuperclass

    final void setSuperclass(String superclass)

  Sets the SuperClass attribute of the SourceClass object

  Parameters:
    `superclass` - The new Superclass value

### setRealised

    final void setRealised(String clazz)

  This method is called for anonymous classes only. Anon classes come in 2 flavours. They either realise a class or an interface.

  Parameters:
    `clazz` -

### setName

    void setName(String name)

  Sets the unqualified name of the class. Should only be called on objects that represent inner classes.

  Parameters:
    `name` - The new Name value

### addInterface

    final void addInterface(String interfaceName)

  Adds an interface that this class implements (if this is a class) or an interface that this interface extends (if this is an interface)

  Parameters:
    `interfaceName` - Describe the method parameter

### resolveImportedClasses

    void resolveImportedClasses()

### addImportedClass

    void addImportedClass(String importedClass)

  Sets the ImportedClasses attribute of the AbstractClass object

  Parameters:
    `importedClass` - Describe the method parameter

### addImportedPackage

    void addImportedPackage(String importedPackage)

  Sets the ImportedPackages attribute of the AbstractClass object

  Parameters:
    `importedPackage` - Describe the method parameter

### addConstructor

    void addConstructor(XConstructor constructor)

  Gets the Constructors attribute of the AbstractClass object

  Parameters:
    `constructor` - Describe the method parameter

### addField

    void addField(XField field)

  Gets the Fields attribute of the AbstractClass object

  Parameters:
    `field` - Describe the method parameter

### addMethod

    void addMethod(XMethod method)

  Gets the Methods attribute of the AbstractClass object

  Parameters:
    `method` - Describe the method parameter

### reset

    void reset()

  Overrides:
    `reset` in class `AbstractProgramElement`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2004 XDoclet Team. All Rights Reserved.