I have a class with numerous parameters of different types. I want to iterate over all elements of type A and run certain functions (A.doSomething ())
It doesn't even compile: conversion from field to XPathDataElement is illegal
Field[] fields = this.getClass().getDeclaredFields();
for (Field field : fields) {
if (field. getType().getName().equals(XPathDataElement.class.getName()))
{
tmp = (XPathDataElement)field;
sb.append(field.getName() + ":");
tmp.update();
}
}
Thanks!
source
share