1717package org .metafacture .flux ;
1818
1919import org .metafacture .commons .ResourceUtil ;
20+ import org .metafacture .commons .reflection .ConfigurableClass ;
2021import org .metafacture .commons .reflection .ObjectFactory ;
2122import org .metafacture .framework .MetafactureException ;
2223import org .metafacture .framework .annotations .Description ;
@@ -80,8 +81,9 @@ private static String getVersionInfo() {
8081 }
8182 }
8283
83- private static <T > void describe (final String name , final ObjectFactory <T > factory , final PrintStream out ) {
84- final Class <? extends T > moduleClass = factory .get (name ).getPlainClass ();
84+ private static <T > void describe (final String name , final ObjectFactory <T > factory , final PrintStream out ) { // checkstyle-disable-line ExecutableStatementCount
85+ final ConfigurableClass <? extends T > configurableClass = factory .get (name );
86+ final Class <? extends T > moduleClass = configurableClass .getPlainClass ();
8587 final Description desc = moduleClass .getAnnotation (Description .class );
8688
8789 out .println (name );
@@ -96,22 +98,29 @@ private static <T> void describe(final String name, final ObjectFactory<T> facto
9698 out .println ("- arguments:\t " + arguments );
9799 }
98100
99- final Map <String , Class <?>> attributes = factory . get ( name ). getSetterTypes ();
101+ final Map <String , Method > attributes = configurableClass . getSetters ();
100102
101103 if (!attributes .isEmpty ()) {
102104 out .print ("- options:\t " );
103105 final StringBuilder builder = new StringBuilder ();
104- for (final Entry <String , Class <?>> entry : attributes .entrySet ()) {
105- if (entry .getValue ().isEnum ()) {
106+ for (final Entry <String , Method > entry : attributes .entrySet ()) {
107+ final Method method = entry .getValue ();
108+ final Class <?> type = configurableClass .getSetterType (method );
109+
110+ if (method .isAnnotationPresent (Deprecated .class )) {
111+ builder .append ("[deprecated] " );
112+ }
113+
114+ if (type .isEnum ()) {
106115 builder .append (entry .getKey ())
107116 .append (" " )
108- .append (Arrays .asList (entry . getValue () .getEnumConstants ()))
117+ .append (Arrays .asList (type .getEnumConstants ()))
109118 .append (", " );
110119 }
111120 else {
112121 builder .append (entry .getKey ())
113122 .append (" (" )
114- .append (entry . getValue () .getSimpleName ())
123+ .append (type .getSimpleName ())
115124 .append ("), " );
116125 }
117126
0 commit comments