public enum CompilerUtils extends Enum<CompilerUtils>
Modifier and Type | Field and Description |
---|---|
static CachedCompiler |
CACHED_COMPILER |
static boolean |
DEBUGGING |
Modifier and Type | Method and Description |
---|---|
static boolean |
addClassPath(@NotNull String dir)
Add a directory to the class path for compiling.
|
static Class |
defineClass(@Nullable ClassLoader classLoader,
@NotNull String className,
@NotNull byte[] bytes)
Define a class for byte code.
|
static void |
defineClass(@NotNull String className,
@NotNull byte[] bytes)
Define a class for byte code.
|
static Class |
loadFromResource(@NotNull String className,
@NotNull String resourceName)
Load a java class file from the classpath or local file system.
|
static CompilerUtils |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CompilerUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static boolean |
writeBytes(@NotNull File file,
@NotNull byte[] bytes) |
static boolean |
writeText(@NotNull File file,
@NotNull String text) |
public static final boolean DEBUGGING
public static final CachedCompiler CACHED_COMPILER
public static CompilerUtils[] values()
for (CompilerUtils c : CompilerUtils.values()) System.out.println(c);
public static CompilerUtils valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Class loadFromResource(@NotNull @NotNull String className, @NotNull @NotNull String resourceName) throws IOException, ClassNotFoundException
className
- expected class name of the outer class.resourceName
- as the full file name with extension.IOException
- the resource could not be loaded.ClassNotFoundException
- the class name didn't match or failed to initialise.public static boolean addClassPath(@NotNull @NotNull String dir)
dir
- to add.public static void defineClass(@NotNull @NotNull String className, @NotNull @NotNull byte[] bytes)
className
- expected to load.bytes
- of the byte code.public static Class defineClass(@Nullable @Nullable ClassLoader classLoader, @NotNull @NotNull String className, @NotNull @NotNull byte[] bytes)
classLoader
- to load the class into.className
- expected to load.bytes
- of the byte code.public static boolean writeText(@NotNull @NotNull File file, @NotNull @NotNull String text)
public static boolean writeBytes(@NotNull @NotNull File file, @NotNull @NotNull byte[] bytes)
Copyright © 2016. All rights reserved.