M
mfazdlie
Hello to all,
I'm mfazdlie, postgraduate student from malaysia, currently doing a
research on java tools, my supervisor adviced me to contact you all
has i am having difficulties in Object Oriented Programming especially
java programming... I need advice how to build a program that will
insert a text automatically in java class program/ source code... for
example...
i have this java class...
class mainprog
{
public void method1( )
{
System.out.println("In method1"); //Inserted automatically by
another program JAVA or C++
//bla... bla.. instructions
System.out.println("End method1"); //Inserted automatically by
another program JAVA or C++
}
public void method2( )
{
System.out.println("In method2"); //Inserted automatically by
another program JAVA or C++
//bla... bla.. instructions
System.out.println("End method2"); //Inserted automatically by
another program JAVA or C++
}
}
Hint:- (Hope this idea help)
The program search line by line text... found the class.. then take
the name class.. then search again.. until found ' { ' ( braclet/
curly bracket) count is = 1 then search again found method.. take
method name.. then after 1st method identify the ' { ' again count is
+ 1 then insert the [ System.out.println(" In + 'method name'
"); ]then search again until found ' } ' then count is - 1 and so on,
before end of the that method, insert [ System.out.println(" End +
'method name' "); ]
Really need help on this... no idea how to build this program??
Your assistance is highly appreciated..
Desperado...
MFO
I'm mfazdlie, postgraduate student from malaysia, currently doing a
research on java tools, my supervisor adviced me to contact you all
has i am having difficulties in Object Oriented Programming especially
java programming... I need advice how to build a program that will
insert a text automatically in java class program/ source code... for
example...
i have this java class...
class mainprog
{
public void method1( )
{
System.out.println("In method1"); //Inserted automatically by
another program JAVA or C++
//bla... bla.. instructions
System.out.println("End method1"); //Inserted automatically by
another program JAVA or C++
}
public void method2( )
{
System.out.println("In method2"); //Inserted automatically by
another program JAVA or C++
//bla... bla.. instructions
System.out.println("End method2"); //Inserted automatically by
another program JAVA or C++
}
}
Hint:- (Hope this idea help)
The program search line by line text... found the class.. then take
the name class.. then search again.. until found ' { ' ( braclet/
curly bracket) count is = 1 then search again found method.. take
method name.. then after 1st method identify the ' { ' again count is
+ 1 then insert the [ System.out.println(" In + 'method name'
"); ]then search again until found ' } ' then count is - 1 and so on,
before end of the that method, insert [ System.out.println(" End +
'method name' "); ]
Really need help on this... no idea how to build this program??
Your assistance is highly appreciated..
Desperado...
MFO