Skip to content

seldridge/reflective-builder

Repository files navigation

This is a standalone utility for evaluating Scala code reflectively. Think Python's eval().

This works by using Java reflection to try to construct an object from a class name that you give it. It then executes a method of that class with provided arguments.

Example usage:

# scala-cli ReflectiveBuilder.scala --main-class ReflectiveBuilder --extra-jars <some-scala-project>/target/scala-2.13/classes -- --object 'foo.bar.Baz' --method apply --argument 'foo.bar$Qux(42, true)'

About

A demonstration of a Scala utility for reflectively building other Scala classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published