Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seldridge/reflective-builder
A demonstration of a Scala utility for reflectively building other Scala classes
https://github.com/seldridge/reflective-builder
Last synced: about 1 month ago
JSON representation
A demonstration of a Scala utility for reflectively building other Scala classes
- Host: GitHub
- URL: https://github.com/seldridge/reflective-builder
- Owner: seldridge
- Created: 2023-06-16T23:14:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-20T19:38:45.000Z (over 1 year ago)
- Last Synced: 2024-10-19T08:18:30.973Z (2 months ago)
- Language: Scala
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a standalone utility for evaluating Scala code reflectively. Think Python's [`eval()`](https://www.programiz.com/python-programming/methods/built-in/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 /target/scala-2.13/classes -- --object 'foo.bar.Baz' --method apply --argument 'foo.bar$Qux(42, true)'
```