sbhavan 30 Light Poster

Hello All,

I have developed a utility class for my own purpose to do some repeated task for my work. In that I want to do some routine task when ever I call any of the method of the class through its object.

For Example,

If my class is StringUtil.class and it handles the task related to Strings,

1. I have the methods like,
i. find the length of the String
ii. find wether it contains only alpha characters
iii. find wether it contains alphanumeric characters
iv. find wether it is null
v. find wether it is a empty String
vi. find wether it contains any special characters

2. when ever I call any one of the methods through the object or the StringUtil class,
By Default it has to trim the string passed to that method.


I can call the trim() method in all the methods and process the String further, But I don't want to repeat it for each and every method.

I want to do it by default for all the methods of that class.


If any body know any alternate or good way to do this, Please suggest me what I have to do?

Thanks in advance.