adavid.reflect
Class PackageResource

java.lang.Object
  |
  +--adavid.reflect.PackageResource

public class PackageResource
extends java.lang.Object
implements Sortable, java.io.Serializable

PackageResource the package resource information, for one package

See Also:
Serialized Form

Field Summary
 java.lang.String pack
          initialized with the constructor and may not be modified afterwards
 java.lang.String path
          initialized with the constructor and may not be modified afterwards
 
Method Summary
 boolean equals(Sortable s)
           
 java.lang.Class[] extensionsOf(java.lang.Class aClass)
          returns the list of extensions of the specified class within this PackageResource
 java.lang.Class[] extensionsOf(java.lang.String name)
          returns the list of extensions of the specified class within this PackageResource, the name may be relative or absolute
 java.lang.Class[] getClasses()
          return the list of classes which are defined in this package
 java.lang.String[] getClassNames()
          returns a list of possible classes for this package we say "possible", that means that the classes are not checked! The names are relative to the package
 java.lang.Class[] getExtClasses()
          returns the list of all extension classes of this package
 java.io.File getFile()
          returns a File object to access the class path may be a directory or a zip file
 java.lang.String getPrefixedPackage()
          returns the package prefix of this package: package_name.
 java.lang.Class[] getTopClasses()
          returns the list of top level (super) classes of this package: the classes which are not extensions of other classes inside this package
 boolean hasClass(java.lang.Class aClass)
          returns true if the class in argument is in this package the test is done on the classes found in this PackageResource
static boolean isClassPresent(java.lang.Class aClass, java.lang.Class[] allClasses)
          returns true if the class in argument is in the class list given in argument, null is not a valid class
 boolean isGreaterThan(Sortable s)
           
 boolean isLessThan(Sortable s)
          implements Sortable
 boolean isTerminal(java.lang.Class aClass)
          returns true if the specified class does not have any extensions in this PackageResource
 java.lang.String makeName(java.lang.String name)
          returns the absolute name, from the relative name
 java.io.InputStream openStream(java.lang.String className)
          opens the stream corresponding to the class name ; null if not found
 java.lang.String toString()
          returns the string representation of this object
 void updateClassNames()
          update the class names: useful if they change=reason why it is public
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

path

public final java.lang.String path
initialized with the constructor and may not be modified afterwards

pack

public final java.lang.String pack
initialized with the constructor and may not be modified afterwards
Method Detail

getFile

public java.io.File getFile()
returns a File object to access the class path may be a directory or a zip file

toString

public java.lang.String toString()
returns the string representation of this object
Specified by:
toString in interface Sortable
Overrides:
toString in class java.lang.Object

getPrefixedPackage

public java.lang.String getPrefixedPackage()
returns the package prefix of this package: package_name. or ""

getClassNames

public java.lang.String[] getClassNames()
returns a list of possible classes for this package we say "possible", that means that the classes are not checked! The names are relative to the package

getClasses

public java.lang.Class[] getClasses()
return the list of classes which are defined in this package

updateClassNames

public void updateClassNames()
update the class names: useful if they change=reason why it is public

getTopClasses

public java.lang.Class[] getTopClasses()
returns the list of top level (super) classes of this package: the classes which are not extensions of other classes inside this package

getExtClasses

public java.lang.Class[] getExtClasses()
returns the list of all extension classes of this package

hasClass

public boolean hasClass(java.lang.Class aClass)
returns true if the class in argument is in this package the test is done on the classes found in this PackageResource

isClassPresent

public static boolean isClassPresent(java.lang.Class aClass,
                                     java.lang.Class[] allClasses)
returns true if the class in argument is in the class list given in argument, null is not a valid class

extensionsOf

public java.lang.Class[] extensionsOf(java.lang.Class aClass)
returns the list of extensions of the specified class within this PackageResource

extensionsOf

public java.lang.Class[] extensionsOf(java.lang.String name)
returns the list of extensions of the specified class within this PackageResource, the name may be relative or absolute

makeName

public java.lang.String makeName(java.lang.String name)
returns the absolute name, from the relative name

isTerminal

public boolean isTerminal(java.lang.Class aClass)
returns true if the specified class does not have any extensions in this PackageResource

openStream

public java.io.InputStream openStream(java.lang.String className)
opens the stream corresponding to the class name ; null if not found

isLessThan

public boolean isLessThan(Sortable s)
implements Sortable
Specified by:
isLessThan in interface Sortable

isGreaterThan

public boolean isGreaterThan(Sortable s)
Specified by:
isGreaterThan in interface Sortable

equals

public boolean equals(Sortable s)
Specified by:
equals in interface Sortable