I'm building a mixin that does different things depending
what component it's added to. I was trying to use the
StrategyBuilder but it does not match the component class
In my AppModule I have this
public static void contributeSimplifySource(
MappedConfiguration<Class,SimplifySource> config) {
config.addInstance(Object.class,SimplifyObject.class);
config.addInstance(Form.class,SimplifyForm.class);
}
When I use the service it always matches Object.class
I looked at the source and wrote this test case:
Map<Class,String> map = new HashMap<Class,String>();
map.put(Form.class,"");
map.put(ClientElement.class,"");
for ( Class t: new InheritanceSearch(container.getClass) ) {
logger.info("{}",t);
if ( map.containsKey(t) ) {
logger.info("match map {}",t);
}
}
When the container is a Form it does not match on Form.class but does
match on ClientElement.class.
It also appears Form.class.equals(container) is false. In some ways
this makes sense because the container is a transformed class but
containter.getClass().getName() is
org.apache.tapestry5.corlib.components.Form
So the question is should this work?
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/StrategyBuilder-Service-and-Components-tp5719036.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]