@CompileStatic class ClassFile extends Object
This class represents a binary class file.
The path to the class file should be a relative, file system path to the
actual file. Examples:
- CORRECT: org/apache/maven/Stuff.class
- NO: /org/apache/maven/Stuff.class
- NO: org.apache.maven.Stuff
- NO: maven.jar!org.apache.maven.Stuff
- NO: maven.jar!/org/apache/maven/Stuff.class
- NO: /path/to/some/directory/org.apache.maven.Stuff
- NO: /path/to/some/directory/org/apache/maven/Stuff.class
The file must exist in either a directory or a jar file, but the path
of the directory/jar is not included in the class file path. Rather,
it's included in the Artifact.
Adapted from org.apache.maven.plugins.enforcer.ClassFile
.
Constructor and description |
---|
ClassFile
(String classFilePath, ResolvedArtifact artifactThisClassWasFoundIn) Constructor. |
Type Params | Return Type | Name and description |
---|---|---|
|
ResolvedArtifact |
getArtifactThisClassWasFoundIn()
|
|
String |
getClassFilePath()
|
|
String |
getHash()
|
Constructor.
classFilePath
- path to the class file. Example: org/apache/maven/Stuff.classartifactThisClassWasFoundIn
- the maven artifact the class appeared in (example: a jar file)