@Module public class ClassEntry extends java.lang.Object implements Dependency
Constructor and Description |
---|
ClassEntry(DynamicClassLoader loader,
java.lang.String name,
Path sourcePath,
Path classPath,
java.security.CodeSource codeSource)
Create a loaded class entry
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addDependencies(DependencyContainer container)
Adds the dependencies, returning true if it's adding itself.
|
static boolean |
canReloadNative() |
boolean |
compileIsModified()
Returns true if the compile doesn't avoid the dependency.
|
DynamicClassLoader |
getClassLoader()
returns the class loader.
|
ClassPackage |
getClassPackage() |
Path |
getClassPath()
Returns the path to the class file.
|
java.security.CodeSource |
getCodeSource() |
java.lang.Class<?> |
getEntryClass() |
java.lang.String |
getName()
Create a loaded class entry
|
Path |
getSourcePath() |
boolean |
isModified()
Returns true if the source file has been modified.
|
static boolean |
isReloadEnabled() |
void |
load(ByteBuffer buffer)
Loads the contents of the class file into the buffer.
|
boolean |
logModified(java.util.logging.Logger log)
Returns true if the source file has been modified.
|
boolean |
postLoad()
post-load actions.
|
void |
preLoad()
preload actions.
|
boolean |
reloadIsModified()
Returns true if the reload doesn't avoid the dependency.
|
static int |
reloadNative(java.lang.Class<?> cl,
byte[] bytes,
int offset,
int length) |
void |
setClassPackage(ClassPackage pkg) |
protected void |
setDependPath(Path dependPath)
Sets the depend path.
|
void |
setEntryClass(java.lang.Class<?> cl) |
void |
setSourceLastModified(long lastModified) |
void |
setSourceLength(long length) |
java.lang.String |
toString() |
public ClassEntry(DynamicClassLoader loader, java.lang.String name, Path sourcePath, Path classPath, java.security.CodeSource codeSource)
name
- the classnamesourcePath
- path to the source Java fileclassPath
- path to the compiled class filepublic java.lang.String getName()
name
- the classnamesourcePath
- path to the source Java fileclassPath
- path to the compiled class filepublic DynamicClassLoader getClassLoader()
public java.security.CodeSource getCodeSource()
public Path getSourcePath()
protected void setDependPath(Path dependPath)
protected boolean addDependencies(DependencyContainer container)
public void setSourceLength(long length)
public void setSourceLastModified(long lastModified)
public ClassPackage getClassPackage()
public void setClassPackage(ClassPackage pkg)
public boolean isModified()
isModified
in interface Dependency
public boolean logModified(java.util.logging.Logger log)
logModified
in interface Dependency
public boolean compileIsModified()
public boolean reloadIsModified()
public Path getClassPath()
public java.lang.Class<?> getEntryClass()
public void setEntryClass(java.lang.Class<?> cl)
public void preLoad() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void load(ByteBuffer buffer) throws java.io.IOException
java.io.IOException
public boolean postLoad()
public static boolean isReloadEnabled()
public java.lang.String toString()
toString
in class java.lang.Object
public static boolean canReloadNative()
public static int reloadNative(java.lang.Class<?> cl, byte[] bytes, int offset, int length)