Code to text formate the input file accordingly
I have to  parse a file, which have text formatting problem i.e. synchronization of braces, i want to create code in java to formate all input file as it appear in java editor... to more understand i m giving a example....



`if(condition){ statement; }`  should appear like that...

    if(condition)
    {
      statement;
    }

and 

    { Console.WriteLine("Message from Car: {0}", e.msg); };  should appear like that...

    {
      Console.WriteLine("Message from Car: {0}", e.msg);
    }


Code to text formate the input file accordingly
===

I have to  parse a file, which have text formatting problem i.e. synchronization of braces, i want to create code in java to formate all input file as it appear in java editor... to more understand i m giving a example....



`if(condition){ statement; }`  should appear like that...

    if(condition)
    {
      statement;
    }

and 

    { Console.WriteLine("Message from Car: {0}", e.msg); };  should appear like that...

    {
      Console.WriteLine("Message from Car: {0}", e.msg);
    }

