jautil.avatar
Class ClassPathAccess

java.lang.Object
  extended by jautil.avatar.BaseAccess
      extended by jautil.avatar.ClassPathAccess
All Implemented Interfaces:
AvatarAccess

public class ClassPathAccess
extends BaseAccess
implements AvatarAccess

Implements the AvatarAccess interface by means of a JAR on the JVM class path. This JAR must contain an empty class called <avatar-name>.Access which resides in the same folder as the avatar definition files and whose sole purpose is to define a resource base against which these files may be loaded. This class is a concrete subclass of BaseAccess, whose AvatarData is populated via the JAR as just described.


Constructor Summary
ClassPathAccess(java.lang.String avname)
          Constructs a class path based avatar access object for the given avatar name.
 
Method Summary
static java.lang.Class<?> getAccessClass(java.lang.String rbname)
          Returns the Java access class for the given resource base name (typically an avatar name).
static java.lang.String getResourceBaseURL(java.lang.Class<?> accessclass)
          A utility method returning a (jar:... resource base URL that contains the given Java access class, which is assumed to be in a class file named Access.class.
static java.lang.String getResourceBaseURL(java.lang.String rbname)
          A utility method returning a (jar:... resource base URL for the given resource base name (typically an avatar name).
 
Methods inherited from class jautil.avatar.BaseAccess
asdData, avatarDefStream, avatarDefURL, avatarName, baseURL, configData, nonmanualsData, terminateAccess
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jautil.avatar.AvatarAccess
asdData, avatarDefStream, avatarDefURL, avatarName, baseURL, configData, nonmanualsData, terminateAccess
 

Constructor Detail

ClassPathAccess

public ClassPathAccess(java.lang.String avname)
                throws AvatarDataException
Constructs a class path based avatar access object for the given avatar name.

Throws:
AvatarDataException
Method Detail

getResourceBaseURL

public static java.lang.String getResourceBaseURL(java.lang.String rbname)
A utility method returning a (jar:... resource base URL for the given resource base name (typically an avatar name). The resource base is expected to be located in the JAR on the JVM class path, and to be the base for a class in that jar named <rbname>.Access (where <rbname> denotes the actual parameter string).


getResourceBaseURL

public static java.lang.String getResourceBaseURL(java.lang.Class<?> accessclass)
A utility method returning a (jar:... resource base URL that contains the given Java access class, which is assumed to be in a class file named Access.class.


getAccessClass

public static java.lang.Class<?> getAccessClass(java.lang.String rbname)
Returns the Java access class for the given resource base name (typically an avatar name). The class name is assumed to be Access in the Java package with the given resource base name, that is, if <rbname> is the actual parameter string then the hierarchical resource name for the class is <rbname>.Access.