Permalink
Browse files

Update README.md

  • Loading branch information...
lukaseder committed Apr 6, 2018
1 parent 5004439 commit 546e8b6c3e7f6c94756721b4b707686e06bfce98
Showing with 17 additions and 0 deletions.
  1. +17 −0 README.md
@@ -70,6 +70,23 @@ String substring = on("java.lang.String")
.substring(6); // Call a proxy method
````

### Runtime compilation of Java code

jOOR has an optional dependency on the `java.compiler` module and simplifies access to `javax.tools.JavaCompiler` through the following API:

```java
Supplier<String> supplier = Reflect.compile(
"com.example.HelloWorld",
"package com.example;\n" +
"class HelloWorld implements java.util.function.Supplier<String> {\n" +
" public String get() {\n" +
" return \"Hello World!\";\n" +
" }\n" +
"}\n").create().get();
// Prints "Hello World!"
System.out.println(supplier.get());
```

### Comparison with standard java.lang.reflect

1 comment on commit 546e8b6

@ooxi

This comment has been minimized.

Copy link
Contributor

ooxi commented on 546e8b6 Apr 6, 2018

🎉

Please sign in to comment.