<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 10/17/15 11:14 AM, Rod Widdowson
      wrote:<br>
    </div>
    <blockquote
      cite="mid:00fa01d108ee$97493110$c5db9330$@steadingsoftware.com"
      type="cite">
      <blockquote type="cite">
        <pre wrap="">.  Is this horribly wrong?  
</pre>
      </blockquote>
      <pre wrap="">
You are not allowed to interpret values in the parser if you want to support property replacement, so that’s going to be problematic.</pre>
    </blockquote>
    <br>
    Thanks for reminding me of this (again).<br>
    <br>
    One of these days I'm going to successfully internalize property
    replacement vis-a-vis the parsers and the related usage of
    FactoryBeans and BeanDefinitionBuilders inside of them.  But
    apparently not yet... <br>
    <br>
    <blockquote
      cite="mid:00fa01d108ee$97493110$c5db9330$@steadingsoftware.com"
      type="cite">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">Is there a better simpler way?
</pre>
      </blockquote>
      <pre wrap="">
Slightly more typing but IMO simpler code is to build a FactoryBean.  Give it a boolean setter "allowDelegation" and a Predicate setter "allowDelegationPredicate".  The buildObject logic could have the "mustn't set both" logic.  Then the parser 'just' has to strip the contents of the attributes and stuff them in to the Builder, Spring does the rest.</pre>
    </blockquote>
    <br>
    Thanks for the hints.  That's what I did and it works perfectly.<br>
    <br>
    <br>
    <blockquote
      cite="mid:00fa01d108ee$97493110$c5db9330$@steadingsoftware.com"
      type="cite">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">Rather than add the new 'allowDelegationPredicateRef' attribute to the schema, would it 
be more appropriate to overload 'allowDelegation' to handle both (String) boolean 
value and bean ref?
</pre>
      </blockquote>
      <pre wrap="">
It strikes me that this might be difficult for a deployer to understand?</pre>
    </blockquote>
    <br>
    Probably, you're right.<br>
    <br>
    <br>
    <blockquote
      cite="mid:00fa01d108ee$97493110$c5db9330$@steadingsoftware.com"
      type="cite">
      <pre wrap=""> I'm also not sure how it would be made to work. 
</pre>
    </blockquote>
    <br>
    I wasn't thinking about property replacement etc.  Without *that*
    requirement my thought was it's pretty simple - look at the
    attribute value and if it's true/false/1/0, treat it like a boolean,
    otherwise treat it like a bean ref.  But totally not worth it.<br>
    <blockquote
      cite="mid:00fa01d108ee$97493110$c5db9330$@steadingsoftware.com"
      type="cite">
    </blockquote>
    <br>
  </body>
</html>