You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* ClassFactory now takes two additional arguments: additional compiler options and parent class loader that is used to load classes that lambda depends on.
* InMemoryClassLoader can now use custom parent class loader.
* InMemoryFileManager now implements StandardJavaFileManager instead of just JavaFileManager. It turns out that Eclipse compiler treats implementations of StandardJavaFileManager differently and it's the only way to make the custom class path work.
* ClassPathExtractor static helper class contains two ways of automatically extracting the classpath of the current JVM, the simpler one is used by default.
* LamdaFactory passes custom class path as an additional compiler option to the ClassFactory.
* LambdaFactoryConfiguration has two new fields: parentClassLoader and compilationClassPath.
* Responsibility of selecting the default java compiler has been moved from LambdaFactory to LambdaFactoryConfiguration.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,6 @@
1
+
# 1.3
2
+
* Custom compilation class path. User can now specify a class path and a class loader used when creating lambda. By default, current JVM class path is used. Thanks to that users can now use custom classes and interfaces in lambda codes (previously only standard library classes were available).
3
+
1
4
# 1.2
2
5
* Dynamic type references. User can now pass a String type name to the constructor of the DynamicTypeReference class instead of statically creating a TypeReference instance with an appropriate generic type.
(You can visit [tests directory](https://github.com/greenjoe/lambdaFromString/tree/master/src/test/java/pl/joegreen/lambdaFromString) to see additional examples.)
33
33
34
-
By default only java.util.function.* is imported by the class, as it is needed by the library itself. If you would like to import additional classes, you can specify imports in the configuration, as shown below. Please note that only Java standard library classes are available on the compilation classpath in the current version of library, so you cannot import your own classes.
34
+
By default only java.util.function.* is imported by the class, as it is needed by the library itself. If you would like to import additional classes, you can specify imports in the configuration, as shown below. Please note that classes used in a lambda need to be available on the classpath used by the library. It can be configured, by default the java.class.path system property is used (it should work fine in most cases).
35
35
36
-
Imports can be passed as `Class<?>` instances or strings (string form is the only way to use * wildcard). Static imports are also supported and can be passed as strings.
36
+
Imports can be passed as `Class<?>` instances or strings (string form is the only way to use wildcards). Static imports are also supported and can be passed as strings.
37
37
38
38
```java
39
39
LambdaFactory factory =LambdaFactory.get(
@@ -62,7 +62,7 @@ You can get it from Maven Central:
62
62
<dependency>
63
63
<groupId>pl.joegreen</groupId>
64
64
<artifactId>lambda-from-string</artifactId>
65
-
<version>1.2</version>
65
+
<version>1.3</version>
66
66
</dependency>
67
67
```
68
68
It has only one external Maven dependency: [Eclipse JDT Core Batch Compiler](http://mvnrepository.com/artifact/org.eclipse.jdt.core.compiler/ecj). That dependency was added because Java compiler is a part of JDK (located in tools.jar) and it's not available in pure JRE. When client applications were running on JRE then no Java compiler was available at runtime and the LambdaFromString library failed to compile lambda code. Eclipse ECJ makes it possible to use LambdaFromString even in cases when only JRE is available at runtime.
@@ -77,7 +77,7 @@ If you are sure that your application will be running on JDK and you want to use
77
77
</exclusion>
78
78
</exclusions>
79
79
```
80
-
In that case you can also use lambdaFromString without Maven by just downloading a [single jar](http://central.maven.org/maven2/pl/joegreen/lambda-from-string/1.2/lambda-from-string-1.2.jar).
80
+
In that case you can also use lambdaFromString without Maven by just downloading a [single jar](http://central.maven.org/maven2/pl/joegreen/lambda-from-string/1.2/lambda-from-string-1.2.jar).
0 commit comments