Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkuhn/bootstrap
Lightweight application initialization helper
https://github.com/rkuhn/bootstrap
Last synced: about 2 months ago
JSON representation
Lightweight application initialization helper
- Host: GitHub
- URL: https://github.com/rkuhn/bootstrap
- Owner: rkuhn
- License: lgpl-2.1
- Created: 2011-04-10T07:28:32.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-05-27T14:22:21.000Z (over 13 years ago)
- Last Synced: 2023-03-23T17:26:49.180Z (almost 2 years ago)
- Language: Scala
- Homepage: http://www.rkuhn.info/BootStrap
- Size: 164 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
README
BootStrap
=========This started out as a lightweight replacement for those large DI frameworks
when all you need is to wire up a few objects. Features:- no transitive dependencies apart from scala-library
- can instantiate any POJO (constructor args or bean setters)
- provides Configuration trait for enhancing user experience if desired
- configuration file format extremely easy to read and writeExample configuration file syntax:
================================================================================
configure SomeThing bob
with SomeProperty 42
with OtherProperty "hello world!"
endconfigure OtherThing constructorDemo
construct arg1
construct reference bob
with Property configure Helper with Name Alice end
call start
end
================================================================================Whitespace is arbitrary except within double-quoted strings. Names are given as
second argument to "configure" and may be referenced only after their
corresponding "end" token (no passing around unfinished objects). The list of
constructors is scanned to find one which is compatible with the arguments
given, where literals are tried to parse using java.lang.Integer.valueOf() and
friends. "with Prop" tries calling a single-argument method named "setProp"
which is compatible with the given argument type. After all is set and done,
parameterless methods may be called by specifying "call".Most of the above is skipped for classes implementing the Configurable
interface, which may enable setter invocations by overriding useBeanSetters()
to return "true". Constructor arguments are not legal, as are method calls. All
arguments not successfully passed into bean setters are wrapped up and passed
into the configure() method. The finished object must be returned wrapped in a
Success. This scheme allows direct configuration as well as factories.See COPYING for licensing information.
Have Fun!
(c) 2011, Roland Kuhn