dimanche 4 janvier 2015

How to get fully qualified name of parameter value in a method

I have to get the fully qualified name of the method paramter.


For example :



public void display(Custom1 a,Custom2 b){
String x=a.getValue();
String y=b.getValue();
}


here Custom1,Custom2 are in com.test.resource so i need to get the value like



com.test.resource.Custom1


I am in need of this in my eclipse plugin.. I used IMethod.getParameterTypes(); .The result is like


QCustom1; how can i get the fully qualified name of the method parameter?



String[] parameterNames = iMethod.getParameterNames();
ILocalVariable[] parameterTypes = currentmethod.getMethod().getParameters();
for (int j=0; j<parameterNames.length; ++j) {
System.out.println("parameter name:"+parameterNames[j]);
System.out.println("parameter type:"+parameterTypes[j].);
}


please provide some ideas... thanks in advance.






Aucun commentaire:

Enregistrer un commentaire