No description
Find a file
2020-11-16 18:02:13 +01:00
javap fixed a bug with wrong utf-8 length and added uniqueness checks. Improved the design 2020-11-10 12:49:10 +01:00
src moved the code to increase visibility 2020-11-16 17:59:12 +01:00
.gitignore API draft, constant pool creator working in principle. A working test 2020-11-09 09:56:33 +01:00
pom.xml fixed a bug with wrong utf-8 length and added uniqueness checks. Improved the design 2020-11-10 12:49:10 +01:00
README.md code example in README.md 2020-11-16 18:02:13 +01:00

beejava

compiles java 'opcode' to bytecode.

project status: early stage

  • At this moment a complete compile cycle is guaranteed (unittested) for a really simple class.
BeeSource createEmptyClass() {
    return BeeSource.builder()
           .withClassFileVersion(Version.V14)
           .withPackage("nl.sander.beejava.test")
           .withAccessFlags(PUBLIC, SUPER)
           .withSimpleName("EmptyBean")
           .withSuperClass(Object.class) // Not mandatory, like in java sourcecode
           .withConstructors(createDefaultConstructor()) // There's no default constructor in beejava. The user must always add them
           .build();
}

BeeConstructor createDefaultConstructor() {
    return BeeConstructor.builder()
            .withAccessFlags(MethodAccessFlags.PUBLIC)
            .withCode(
                    line(0, LD_VAR, Ref.THIS),
                    line(1, INVOKE, Ref.SUPER, "<init>", "()"),
                    line(5, RETURN))
            .build();
 }