pawan chopra wrote:In above case {0} represents the number of bags. I was just thinking if instead of 0 I can say {numberOfBags}. is it possible by any way?
Is numberOfBags another property in the file? If so, you can definitely get this to work. Well, I could
I won't give you my full class, but here are a few hints:
- Get the result of getProperty(key).
- Use a
Pattern to get all the templates.
- For each template, use a recursive call to get their values and replace the value.
One thing: take care of loops. Consider you have two properties, "property1 = Value of property2 is {property2}" and "property2 = Value of property1 is {property1}". Now you want to get the value of property1. For this you need the value of property2. For this you need the value of property1. Oops. Note that this is the simplest form of looping; it can use many intermediate properties to form a loop.