private void doTraceArguments(final PrintStream printStream) {
        try {
            final BeanInfo beanInfo = Introspector.getBeanInfo(this.getClass());
            for (final PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
                // Only do properties with getters
                if (pd.getWriteMethod() != null) {
                    // Simple getter ?
                    String suffix = " (default)";
                    if (map.containsKey(pd.getName())) {
                        suffix = " (arg)";
                    }
                    String value = "";

                    if (pd.getReadMethod() != null && pd.getReadMethod().getParameterTypes().length == 0) {
                        value = String.valueOf(pd.getReadMethod().invoke(this));
                    } else {
                        // No simple getter
                        Field field = null;
                        try {
                            field = this.getClass().getDeclaredField(pd.getName());
                        } catch (final NoSuchFieldException nsfex) {
                            // Ignore
                        }
                        if (field != null) {
                            field.setAccessible(true);
                            value = String.valueOf(field.get(this));
                        } else {
                            value = "?";

                        }
                    }
                    printStream.println(Strings.padEnd(pd.getName(), maxPropLength, ' ') + " = " + value + suffix);
                }
            }
        } catch (final IntrospectionException | IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
Base class for command line tools that handles setting a load of args on the
program as name value pairs.
stroom-util/src/main/java/stroom/util/AbstractCommandLineTool.java