...
Hierarchy
- Object
- GroovyObjectSupport
- Binding
- FactoryBuilderSupport
- griffon.builder.UberBuilder
- griffon.gui.GUIBuilder
- griffon.builder.UberBuilder
- FactoryBuilderSupport
- Binding
- GroovyObjectSupport
The logic to support all of the non-specific builder magic will go into UberBuidlerUberBuilder. GUIBuilder will be an instance if UberBuilder with specific factories pre-loaded into the cache.
Constructor
The only consructor constructor will be
| Code Block |
|---|
UberBuilder(Object[] builders) {
builders.each {if (it) uberInit(it)}
} |
...
| Code Block |
|---|
UberBuilder('ant', 'swing', 'DOM')
UberBuidlerUberBuilder(AntBuidlerAntBuilder, SwingBuilder, DOMBuilder)
UberBuilder(new AntBuidlerAntBuilder(), new SwingBuilder(), new DOMBuilder() |
...
First, there will be an internal registry mapping, mapping some object (usually strings) to the relevant registrations for the UberBuidlerUberBuilder. Hence the fallback case:
...
We basically try to init again if we don't get a match, except we look at the internal registry cache to 'de-reference' the symbol. Usually a String, but there may be instances where we may want to intercept a class. (should we move the dereferenceing dereferencing to the constructor?)
String
This is always a de-reference. May We may not even need an uberInit method, except for clarity.
Class
If the class is assignable to FactoryBuilderSupport, we attempt to no-args construct it. If we are successfull successful we feed it to uberInit(FactoryBuilderSupport), if not we feed it to uberInit(Object) before failing.
...
- We can wrap the builder's nodes using withBuilder and re-direct them into the proxy
- We can take all of the registerd registered factories and stuff them into this UberBuilder.
...