Custom attribute resolver integration with Spring

Rod Widdowson rdw at steadingsoftware.com
Fri Feb 1 10:19:25 EST 2019


James,
Thanks for the respost...

> I've created a custom attribute resolver by following
Glad to know it's useful.

> This is all working fine. But I can't get @Autowire and @Value annotations
> to work. I've added the @Service annotation to the attribute resolver bean,
> and I've added a <util:properties tag in global.xml to specify the location
> of the properties file (as well as just using idp.properties).

In general we absolutely do not use the Spring Annotations for our production code.  I know that we use them in tests and other will
dive in with hints.
 
> I'm not a Spring expert so I might be missing something very basic. Will I
> need a factory bean to complete any extra Spring config when creating the
> bean?

You shouldn't.  But first a question: are you writing your own parser to extend the custom syntax?

<AttributeDefinition xsi:type="james:WunderType" ..../>

Or are you wiring entirely in Spring native?

<bean id-"def" class="org.example.whatever.WunderType" > ....

If the latter you "just add XML".  

If the former in many cases you can do it all in the doParse method.  Factory beans become more important mostly in the case of
custom parsers and making sure that you follow properties...

Rod



More information about the dev mailing list