File tree Expand file tree Collapse file tree
src/main/java/org/scijava/param Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,9 +58,14 @@ public static List<Member<?>> parse(final Class<?> type)
5858
5959 final Class <?> paramsClass = findParametersDeclaration (type );
6060 if (paramsClass != null ) {
61- final Parameters params = paramsClass .getAnnotation (Parameters .class );
6261 final Class <?> functionalType = findFunctionalInterface (paramsClass );
63- final Parameter [] p = params .value ();
62+ Parameter [] p = null ;
63+ final Parameters params = paramsClass .getAnnotation (Parameters .class );
64+ if (params != null ) {
65+ p = params .value ();
66+ } else {
67+ p = new Parameter [] {paramsClass .getAnnotation (Parameter .class )};
68+ }
6469 final int paramCount = functionalType .getTypeParameters ().length ;
6570 // TODO: Consider allowing partial override of class @Parameters.
6671 if (p .length == paramCount ) {
@@ -153,7 +158,8 @@ private static Class<?> findParametersDeclaration(final Class<?> type) {
153158 types .add (type );
154159 while (!types .isEmpty ()) {
155160 final Class <?> candidate = types .pop ();
156- if (candidate .getAnnotation (Parameters .class ) != null ) return candidate ;
161+ if (candidate .getAnnotation (Parameters .class ) != null ||
162+ candidate .getAnnotation (Parameter .class ) != null ) return candidate ;
157163 final Class <?> superType = candidate .getSuperclass () ;
158164 if (superType != null ) types .add (superType );
159165 types .addAll (Arrays .asList (candidate .getInterfaces ()));
You can’t perform that action at this time.
0 commit comments