Package org.glassfish.rmic.tools.java
Class Package
- java.lang.Object
-
- org.glassfish.rmic.tools.java.Package
-
public class Package extends java.lang.ObjectThis class is used to represent the classes in a package. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
-
-
Field Summary
Fields Modifier and Type Field Description private ClassPathbinaryPathThe path which we use to locate class (binary) files.private java.lang.StringpkgThe path name of the package.private ClassPathsourcePathThe path which we use to locate source files.
-
Constructor Summary
Constructors Constructor Description Package(ClassPath binaryPath, Identifier pkg)Create a package given a source path, binary path, and package name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclassExists(Identifier className)Check if a class is defined in this package.booleanexists()Check if the package existsClassFilegetBinaryFile(Identifier className)Get the .class file of a classClassFilegetSourceFile(java.lang.String fileName)ClassFilegetSourceFile(Identifier className)Get the .java file of a classprivate java.lang.StringmakeName(java.lang.String fileName)java.lang.StringtoString()
-
-
-
Constructor Detail
-
Package
public Package(ClassPath binaryPath, Identifier pkg)
Create a package given a source path, binary path, and package name.
-
-
Method Detail
-
classExists
public boolean classExists(Identifier className)
Check if a class is defined in this package. (If it is an inner class name, it is assumed to exist only if its binary file exists. This is somewhat pessimistic.)
-
exists
public boolean exists()
Check if the package exists
-
makeName
private java.lang.String makeName(java.lang.String fileName)
-
getBinaryFile
public ClassFile getBinaryFile(Identifier className)
Get the .class file of a class
-
getSourceFile
public ClassFile getSourceFile(Identifier className)
Get the .java file of a class
-
getSourceFile
public ClassFile getSourceFile(java.lang.String fileName)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-