visidia.misc
Class ClassIdentifier

java.lang.Object
  extended by visidia.misc.ClassIdentifier
All Implemented Interfaces:
java.io.Serializable

public class ClassIdentifier
extends java.lang.Object
implements java.io.Serializable

This class manages some properties about classes loaded at runtime: url, package name, class name, if the class is in a JAR file.

See Also:
Serialized Form

Field Summary
static ClassIdentifier emptyClassId
          The Constant emptyClassId.
 
Constructor Summary
ClassIdentifier(java.lang.Class<?> instanceType)
          Instantiates a new class identifier.
ClassIdentifier(java.net.URL url)
          Instantiates a new class identifier.
ClassIdentifier(java.net.URL url, java.lang.String baseDir, java.lang.String className)
          Instantiates a new class identifier.
 
Method Summary
 java.lang.String getClassName()
          Gets the class name.
 java.lang.Class<?> getInstanceType()
          Gets the instance type.
 java.lang.String getPackageName()
          Gets the package name.
 java.net.URL getURL()
          Gets the URL.
 boolean isInJarFile()
          Checks if is in jar file.
 void setInstanceType(java.lang.Class<?> instanceType)
          Sets the instance type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emptyClassId

public static final transient ClassIdentifier emptyClassId
The Constant emptyClassId.

Constructor Detail

ClassIdentifier

public ClassIdentifier(java.lang.Class<?> instanceType)
Instantiates a new class identifier.

Parameters:
instanceType - the instance type

ClassIdentifier

public ClassIdentifier(java.net.URL url)
Instantiates a new class identifier.

Parameters:
url - the URL

ClassIdentifier

public ClassIdentifier(java.net.URL url,
                       java.lang.String baseDir,
                       java.lang.String className)
Instantiates a new class identifier.

Parameters:
url - the URL
baseDir - the base directory
className - the class name
Method Detail

getURL

public java.net.URL getURL()
Gets the URL.

Returns:
the URL

isInJarFile

public boolean isInJarFile()
Checks if is in jar file.

Returns:
true, if is in jar file

getPackageName

public java.lang.String getPackageName()
Gets the package name.

Returns:
the package name

getClassName

public java.lang.String getClassName()
Gets the class name.

Returns:
the class name

getInstanceType

public java.lang.Class<?> getInstanceType()
Gets the instance type.

Returns:
the instance type

setInstanceType

public void setInstanceType(java.lang.Class<?> instanceType)
Sets the instance type.