classpathhelper
Class ContentDescription

java.lang.Object
  extended byclasspathhelper.ContentDescription
Direct Known Subclasses:
ClassDescription

public class ContentDescription
extends java.lang.Object

In 1.0 versions of Classpath Helper all references to other objects where handled as strings. This prevented deep loading by allowing name based handles to an object.

In 1.1 and later CGClassLoader supports the CGClassLoader.getResource(String)} methods. This means we have multiple types of content that can be retrieved from a class loader. We have classes which are displayed in one format, and resources which are described in a relative path format.

If we continued to use strings to identify components then all clients would need to inspect the string to try to determine what type of object it is. To prevent this we create this description class to represent generic content. It's subclass ClassDescription defines class based content. This allows clients to use the toString() method correctly display the name, while also have classified references.

Usage

In most cases clients will use the


    contentDescription.toString();
    contentDescription.getPackageName();
 
methods. TODO: In the future CGClassLoader will have a generic getContentDetail method whilch will accept subclasses of ContentDescription and return the correct detail object. Fix this Java doc when that is completed.

Since:
1.1
Author:
bharris

Constructor Summary
ContentDescription(java.lang.String thePath, SessionCache theSessionCache)
          The path to this content (forward slashes only.)
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
          The name (not including package)
 java.lang.String getPackageName()
          The package name for this content.
 java.lang.String getPath()
          Retrieve the path to this object.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentDescription

public ContentDescription(java.lang.String thePath,
                          SessionCache theSessionCache)
The path to this content (forward slashes only.)

Parameters:
thePath - The path.
theSessionCache - The cache to pull package info from.
Since:
1.1
Method Detail

getName

public java.lang.String getName()
The name (not including package)

Returns:
The name of this content.
Since:
1.1

getPath

public java.lang.String getPath()
Retrieve the path to this object.

Returns:
The path (forward slash delimeted).
Since:
1.1

getPackageName

public java.lang.String getPackageName()
The package name for this content.

Returns:
The package name (or "" if the root package).
Since:
1.1

toString

public java.lang.String toString()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)