Howdy,

I am looking for some feedback on the attached classes I wrote to do ${...} 
style parameter substitution. Please let me know if this whole thing is silly:

ParameterParser extracts the parameters and calls the lookup method of 
MailParameterContext which matches the XX part of any getXX method of Mail 
objects. Sample use:

<mailet match="All" class="SomeMailet">
<message>
This person ${sender} sent a message with the virus ${attribute.viruses}.
</message>
</mailet>

SomeMailet would contain: 

ParameterParser p = new ParameterParser(new MailParameterParser(mail));
String message = p.parse(getInitParameter("message"));

This would invoke mail.getSender() for ${sender} and 
mail.getAttribute("viruses") for ${attribute.viruses}

Thanks,

Josh 

Attachment: ParameterParser.zip
Description: Zip compressed data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to