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 SourceClass

    java.lang.Object
      xjavadoc.AbstractProgramElement
          xjavadoc.AbstractClass
              xjavadoc.SourceClass

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

public final class SourceClass
extends AbstractClass

This class represents a class for which the source code is available XJavaDocFil

Author:
  Aslak Hellesøy

Field Summary
`static int` | `instanceCount`

Fields inherited from class xjavadoc.AbstractProgramElement
`EMPTY_LIST`

Constructor Summary
`SourceClass(SourceClass mainClass, int dummy, XTagFactory tagFactory)` Constructor to use for "extra" classes, that is, secondary classes that figure in the same source.
`SourceClass(SourceClass containingClass, XTagFactory tagFactory)` Constructor to use for inner classes.
`SourceClass(XJavaDoc xJavaDoc, AbstractFile sourceFile, boolean useNodeParser, XTagFactory tagFactory, String encoding)` Constructor to use for outer classes
`SourceClass(XJavaDoc xJavaDoc, File sourceFile, boolean useNodeParser, XTagFactory tagFactory)`
`SourceClass(XJavaDoc xJavaDoc, File sourceFile, XTagFactory tagFactory)` Constructor to use for outer classes
`SourceClass(XJavaDoc xJavaDoc, Reader sourceFile, XTagFactory tagFactory)` Constructor to use for outer classes

Method Summary
`void` | `addTagForValidation(DefaultXTag tag)`
`SimpleNode` | `getCompilationUnit()`
`AbstractFile` | `getFile()`
`static String` | `getFileName(String qualifiedName)` Describe what the method does
`String` | `getNextAnonymousClassName()` Returns "1", "2", etc., depending on how many inner classes we have.
`Reader` | `getReader()` Returns a reader for the source code.
`boolean` | `isExtraClass()`
`boolean` | `isPrimitive()` Returns true if this class is a primitive.
`boolean` | `isWriteable()` Gets the Writeable attribute of the SourceClass object
`long` | `lastModified()` Describe what the method does
`void` | `print(Writer out)` Prints this class to a stream
`XClass` | `qualify(String unqualifiedClassName)` Returns fully qualified name of a class.
`void` | `reset()`
`String` | `save(File rootDir)` Saves the class at root dir rootDir.
`boolean` | `saveNeeded()` whether class needs saving
`void` | `setCompilationUnit(SimpleNode compilationUnit)` Called by JavaParser at the end of the parsing
`void` | `setDirty()` say this class is dirty and needs saving propagate to outer class ( if any )
`void` | `validateTags()` Called by XJavaDoc after the entire source is parsed, but only if validation is on.

Methods inherited from class xjavadoc.AbstractClass
`addConstructor, addField, addImportedClass, addImportedPackage, addInnerClass, addInterface, addMethod, compareTo, equals, getAllSubclasses, getConstructor, getConstructors, getContainingPackage, getDeclaredInterfaces, getDirectSubclasses, getExtendingInterfaces, getField, getFields, getFields, getFields, getImplementingClasses, getImportedClasses, getImportedPackages, getInnerClasses, getInterfaces, getMethod, getMethod, getMethods, getMethods, getMethods, getMethodTags, getName, getQualifiedName, getSuperclass, getSuperElement, getSuperInterfaceElements, getTransformedName, getTransformedQualifiedName, getType, hashCode, hasImportedClasses, hasImportedPackages, hasInnerClasses, isA, isA, isAnonymous, isImplementingInterface, isImplementingInterface, isInner, isInterface, isSubclassOf, isSubclassOf, resolveImportedClasses, setContainingPackage, setInterface, setName, setQualifiedName, setRealised, setSuperclass, toString, updateDoc`

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`

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

Field Detail

### instanceCount

    public static int instanceCount

Constructor Detail

### SourceClass

    public SourceClass(SourceClass containingClass,
                       XTagFactory tagFactory)

  Constructor to use for inner classes.

Parameters:
  `containingClass` - The containing class;

### SourceClass

    public SourceClass(SourceClass mainClass,
                       int dummy,
                       XTagFactory tagFactory)

  Constructor to use for "extra" classes, that is, secondary classes that figure in the same source.

Parameters:
  `mainClass` - The containing class. Or rather the "main" class in the source.
  `dummy` -

### SourceClass

    public SourceClass(XJavaDoc xJavaDoc,
                       File sourceFile,
                       XTagFactory tagFactory)

  Constructor to use for outer classes

Parameters:
  `sourceFile` - The file containing the source

### SourceClass

    public SourceClass(XJavaDoc xJavaDoc,
                       Reader sourceFile,
                       XTagFactory tagFactory)

  Constructor to use for outer classes

Parameters:
  `sourceFile` - The file containing the source

### SourceClass

    public SourceClass(XJavaDoc xJavaDoc,
                       File sourceFile,
                       boolean useNodeParser,
                       XTagFactory tagFactory)

Parameters:
  `sourceFile` -
  `useNodeParser` -

### SourceClass

    public SourceClass(XJavaDoc xJavaDoc,
                       AbstractFile sourceFile,
                       boolean useNodeParser,
                       XTagFactory tagFactory,
                       String encoding)

  Constructor to use for outer classes

Parameters:
  `sourceFile` - The file containing the source
  `useNodeParser` -

Method Detail

### getFileName

    public static String getFileName(String qualifiedName)

  Describe what the method does

  Parameters:
    `qualifiedName` - Describe what the parameter does
  Returns:
    Describe the return value

### isExtraClass

    public boolean isExtraClass()

### getNextAnonymousClassName

    public String getNextAnonymousClassName()

  Returns "1", "2", etc., depending on how many inner classes we have.

  Returns:
    String containing number of next anonymous inner class

### isWriteable

    public boolean isWriteable()

  Gets the Writeable attribute of the SourceClass object

  Returns:
    The Writeable value

### getCompilationUnit

    public SimpleNode getCompilationUnit()

### getReader

    public Reader getReader()

  Returns a reader for the source code.

  Returns:
    a reader for the source code.

### getFile

    public AbstractFile getFile()

### isPrimitive

    public boolean isPrimitive()

  Description copied from interface: `XClass`
  Returns true if this class is a primitive. That is, one of the following:
  - boolean
  - byte
  - char
  - double
  - float
  - int
  - long
  - short
  - java.lang.Boolean
  - java.lang.Byte
  - java.lang.Character
  - java.lang.Double
  - java.lang.Float
  - java.lang.Integer
  - java.lang.Long
  - java.lang.Short
  - java.lang.String

  Returns:
    true if a primitive

### setDirty

    public void setDirty()

  say this class is dirty and needs saving propagate to outer class ( if any )

### setCompilationUnit

    public void setCompilationUnit(SimpleNode compilationUnit)

  Called by JavaParser at the end of the parsing

  Parameters:
    `compilationUnit` - The new CompilationUnit value

### validateTags

    public void validateTags()
                      throws TagValidationException

  Called by XJavaDoc after the entire source is parsed, but only if validation is on.

  Throws:
    `TagValidationException`

### addTagForValidation

    public void addTagForValidation(DefaultXTag tag)

### saveNeeded

    public boolean saveNeeded()

  Description copied from interface: `XClass`
  whether class needs saving

  Returns:
    true if save needed

### lastModified

    public long lastModified()

  Describe what the method does

  Specified by:
    `lastModified` in interface `XClass`
  Overrides:
    `lastModified` in class `AbstractClass`
  Returns:
    Describe the return value

### print

    public void print(Writer out)

  Prints this class to a stream

  Parameters:
    `out` - Describe what the parameter does

### save

    public String save(File rootDir)
                throws IOException

  Saves the class at root dir rootDir. The actual java file is derived from tha package name. If no root dir is specified, save where it was loaded from

  Specified by:
    `save` in interface `XClass`
  Overrides:
    `save` in class `AbstractClass`
  Parameters:
    `rootDir` - the root directory.
  Returns:
    the relative fileName to which the file was saved.
  Throws:
    `IOException` - if the file couldn't be saved

### qualify

    public XClass qualify(String unqualifiedClassName)

  Returns fully qualified name of a class. 1: check for "." 2: if "." it's already qualified 3: if no ".", must try with all imported packages or classes

  Specified by:
    `qualify` in interface `XClass`
  Overrides:
    `qualify` in class `AbstractClass`
  Parameters:
    `unqualifiedClassName` - Describe what the parameter does
  Returns:
    Describe the return value

### reset

    public void reset()

  Overrides:
    `reset` in class `AbstractClass`

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.