[stringtemplate-interest] Top-Down automatic attributeaggregation?
Kunle Odutola
Kunle_Odutola at hotmail.com
Thu May 18 06:42:10 PDT 2006
Hi Ulf,
> > Ter said:
> > Yeah, i'd go with the map. Might have to wrap those objects if you
> > have no control over them to change their implementation.
> Ulf replied:
> I think, I've worked it out. After looking closely at StringTemplate.cs
> I now create a tree structure of alternating Hashtables and ArrayLists
> and put them into the root-templaty via rootTemplate.Attributes=XYZ
> (this is a public r/w property in the c# implementation - I haven't
> testet in Java)
You are right that Attributes is currently a part of the public ST API. I'm
not convinced that it should continue to do so however.
For your particular situation, why did you reject the more obvious
SetAttribute("root", XYZ) or similar?
> XYZ = Hashtable[AttributeA,AttributeB,AttributeC]
> AttributeA = ArrayList[Hashtable[AttributeAA,AttributeAB...]
> AttributeB = ArrayList[Hashtable[AttributeBA,AttributeBB...]
>
> Here is the part where you scream "NOOOO! It wasn't meant that way!"
> Or - better yet - say "That's what I meant"
I'd suggest the SetAttribute() option simply because SetAttribute() does
more than just hook up an attribute map.
Kunle
PS The issue you reported has been fixed in the depot. Thanks. I'll try
and get something out to you.
More information about the stringtemplate-interest
mailing list