
org.broadinstitute.barclay.argparser.CommandLineParserUtilities Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of barclay Show documentation
Show all versions of barclay Show documentation
Development on Barclay command line parsing and documentation utilities
The newest version!
package org.broadinstitute.barclay.argparser;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
// package private
class CommandLineParserUtilities {
// This can be moved into CommandlineArgumentParser once there is only one parser implementation.
/**
* Return a list of all {@link Field} in the class {@code clazz} and its base classes.
* @param clazz class to interrogate for {@link Field}
* @return list of all {@link Field} in the class {@code clazz} and its base classes
*/
public static List getAllFields(Class> clazz) {
final List ret = new ArrayList<>();
do {
ret.addAll(Arrays.asList(clazz.getDeclaredFields()));
clazz = clazz.getSuperclass();
} while (clazz != null);
return ret;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy