you are basically writing a compiler. That requires you to have a very strict definition of what you have, what you want, and how you get from the former to the latter.
Can you explain in English exactly how you get from one to the other? Simply providing an example or two (or even 30) is NOT a definition. It needs to be 100% deterministic as to what is allowed and what is not.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree with Junilu. Don't use a format which is rather like XML, since then you have to write your own parser. Use XML, then you can use parsers which already exist.
posted 7 years ago
Actually this is my office work which we have to do manually (takes a lot of time & frustration because of hundreds of lines like those I mentioned) and I was trying to make it simpler by automating it so can't give up.
Yes it is indeed XML based but that is how we receive it from another team working on the same project so I can't change it to pure XML.
Ok let me explain in pure English if people can help:
Suppose we have:
<abc xsi:type:ClassA>.<xyz xsi:type:ClassB>.<def>
(abc,xyz,def are basically setter methods here and xsi:type following them is the return type for them)
1. I start by writing
private static <name of class after xsi:type:> get<name of tag before xsi:type: with proper camelspace naming> ( )
which gives us
private static ClassA getAbc ()
2. Under it I first make an object of ClassA
ClassA classA=new ClassA();
then I use the setter of this object to set xyz which is of type ClassB