lexx.api
Class ClassName

java.lang.Object
  |
  +--lexx.api.ClassName
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class ClassName
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Loads in Class files

Copyright: Copyright (c) 2003

The point of this ClassName is to get the Class object from an external file such as a jar file, .class file

Version:
1.0
Author:
Mohammed Imran
See Also:
Serialized Form

Constructor Summary
ClassName(java.lang.String pathName, java.lang.String className, java.lang.String filePath)
          Reads in a java class file
ClassName(java.lang.String pathName, java.lang.String className, java.lang.String filePath, boolean shouldShowFullName)
          Reads in a java class file
 
Method Summary
 java.lang.Object clone()
          This is required for serilization
 boolean equals(java.lang.Object obj)
           
 java.lang.Class getClassObject()
           
 java.lang.String getFilePath()
           
 java.lang.String getFullName()
           
 java.lang.String getName()
           
 java.lang.String getPath()
           
 void setShowFullName(boolean answer)
          Change if toString displays the full class name or just the short version
 java.lang.String toString()
          displays the full class name or just the short version
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassName

public ClassName(java.lang.String pathName,
                 java.lang.String className,
                 java.lang.String filePath)
Reads in a java class file

Parameters:
pathName - - Package Name e.g. if the class is javax.swing.JPanel then the package name is java.swing
className - - Class Name e.g. if you have javax.swing.JPanel then classname is JPanel
filePath - - Is either the BASE directory of the class files or a jar file

ClassName

public ClassName(java.lang.String pathName,
                 java.lang.String className,
                 java.lang.String filePath,
                 boolean shouldShowFullName)
Reads in a java class file

Parameters:
pathName - - Package Name e.g. if the class is javax.swing.JPanel then the package name is java.swing
className - - Class Name e.g. if you have javax.swing.JPanel then classname is JPanel
filePath - - Is either the BASE directory of the class files or a jar file
shouldShowFullName - - when toString is called if it should display the full name or not. Either show javax.swing.JPanel or just JPanel
Method Detail

clone

public final java.lang.Object clone()
This is required for serilization

Overrides:
clone in class java.lang.Object
Returns:
- Makes a copy of ClassName

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

setShowFullName

public final void setShowFullName(boolean answer)
Change if toString displays the full class name or just the short version

Parameters:
answer -

getFilePath

public final java.lang.String getFilePath()
Returns:
the name of the jar file or directory that contains the class files

getPath

public final java.lang.String getPath()
Returns:
the package name of class for example if you had java.util.List it would return java.util

getName

public final java.lang.String getName()
Returns:
short name of class for example if you had java.util.List it would return List

toString

public final java.lang.String toString()
displays the full class name or just the short version

Overrides:
toString in class java.lang.Object

getFullName

public final java.lang.String getFullName()

getClassObject

public final java.lang.Class getClassObject()
Returns:
the Class from the external file