jreversepro.reflect
Class JImport

java.lang.Object
  extended by jreversepro.reflect.JImport

public class JImport
extends java.lang.Object

Describes the Set fof import statements.

Author:
Karthik Kumar.

Constructor Summary
JImport()
          no-arg constructor
 
Method Summary
 void addClass(java.lang.String importClass)
          Adds a new class to the list of classes referenced by the current class.
static java.lang.String getClassName(java.lang.String fullQualifiedName)
          Returns the Class name alone from a fully qualified name.
 java.lang.String getImportClasses(java.lang.String packageName)
          Returns a string that contains all the imported classes in the proper format as written in code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JImport

public JImport()
no-arg constructor

Method Detail

addClass

public void addClass(java.lang.String importClass)
Adds a new class to the list of classes referenced by the current class.

Parameters:
importClass - name of new class.

getClassName

public static java.lang.String getClassName(java.lang.String fullQualifiedName)
Returns the Class name alone from a fully qualified name.

For Example , if FullName = java/lang/StringBuffer,
then a call to getClassName(arg) returns the value StringBuffer .

Parameters:
fullQualifiedName - A Fully Qualified Name.
Returns:
the class name , alone.

getImportClasses

public java.lang.String getImportClasses(java.lang.String packageName)
Returns a string that contains all the imported classes in the proper format as written in code. For eg, if the list contains p1.class1 , p2.class2 , this generates a string with import statements for both of them. classes belonging to the default package are excluded. Also there is an option by which we can exclude the classes that belong to a given package ( current package ).

Parameters:
packageName - current packagename and name for which package name is to be excluded.
Returns:
String containing the code mentioned.


Submit Feedback to akkumar@users.sourceforge.net