Class[] parameterTypes = m.getParameterTypes();
if (parameterTypes.length != 1 || parameterTypes[0] != String.class)
continue;
// Skip methods that do not have an "EnabledFor" annotation.
EnabledFor enabledFor = m.getAnnotation(EnabledFor.class);
if (enabledFor == null)
continue;
// The EnabledFor annotation will indicate patterns for the data
// names that the method will translate. Convert these into a
// PatternList, and add the result to our map of filters.
PatternList patternList = new PatternList();
for (String onePattern : enabledFor.value())
patternList.addRegexp(onePattern);
filters.put(patternList, m);
}
}