I would like to invoke a method which has an enum type as parameter with reflection. How to do this.
Code:
@When("^I click on the (\\d+)st link inside the \"(.*?)\" filter$")
public void i_click_on_the_st_link_inside_the_filter(int index, FiltersEnum filter)
}
public void invokemethod() {
Class<?>[] param = new Class[2];
param[0] = Integer.TYPE;
param[1] =
Object localObject = this.getSourceObject();
Method method = localObject.getClass().getMethod("i_click_on_the_st_link_inside_the_filter",param);
method.invoke(this.getSourceObject(), this.getValues());
}
The question is what should be the param[1] = in the case of FiltersEnum filter parameter?