From e493ad32a048138e6cd8306f9f34d8b274a8bc96 Mon Sep 17 00:00:00 2001 From: Sander Hautvast Date: Mon, 16 Nov 2020 18:02:13 +0100 Subject: [PATCH] code example in README.md --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c2db9be..d28a0c6 100644 --- a/README.md +++ b/README.md @@ -5,24 +5,24 @@ project status: early stage * At this moment a complete compile cycle is guaranteed (unittested) for a really simple class. ``` -BeeSource createEmptyClass() throws ClassNotFoundException { - 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(); - } +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() throws ClassNotFoundException { - return BeeConstructor.builder() - .withAccessFlags(MethodAccessFlags.PUBLIC) - .withCode( - line(0, LD_VAR, Ref.THIS), - line(1, INVOKE, Ref.SUPER, "", "()"), - line(5, RETURN)) - .build(); - } +BeeConstructor createDefaultConstructor() { + return BeeConstructor.builder() + .withAccessFlags(MethodAccessFlags.PUBLIC) + .withCode( + line(0, LD_VAR, Ref.THIS), + line(1, INVOKE, Ref.SUPER, "", "()"), + line(5, RETURN)) + .build(); + } ``` \ No newline at end of file