com.github.fierioziy.utils.TempClassLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ParticleNativeAPI Show documentation
Show all versions of ParticleNativeAPI Show documentation
Provides API for spawning particles on Spigot server.
package com.github.fierioziy.utils;
/**
* A basic classloader with public method for class definition.
*/
public class TempClassLoader extends ClassLoader {
/**
* Construct a new class loader linked to parameter class loader.
*
* @param parent a parent class loader to which this
* class loader belongs.
*/
public TempClassLoader(ClassLoader parent) {
super(parent);
}
/**
* Defines a class with parameter name and bytecode
* stored in {@code byte[]} array.
*
* @param name name of the class to define.
* @param b a {@code byte[]} array containing bytecode of class
* to define.
* @return a {@code Class>} object made
* from provided bytecode.
*/
public Class> defineClass(String name, byte[] b) {
return super.defineClass(name, b, 0, b.length);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy