/** * Get the property name associated with a configuration interface method. * If a {@link Property} annotation is present, that value is returned. * Otherwise the {@link #getPropertyPrefix interface prefix} is concatenated * with the {@link #extendedUncapitalize uncapitalized} property name. * * @param configInterface The configuration interface. * @param method The method. * @return The property name. */ public static String getPropertyName(Class<?> configInterface, Method method) { Property property = getAnnotation(configInterface, method, Property.class, false); if (property != null) { return property.value(); } else { String prefix = getPropertyPrefix(configInterface); String methodName = method.getName(); Matcher matcher; if (((matcher = ACCESS_RE.matcher(methodName)).matches() || (matcher = LISTENER_RE.matcher(methodName)).matches()) && !"".equals(matcher.group(2))) { String prop = matcher.group(2); return prefix + extendedUncapitalize(prop); } else { throw new IllegalArgumentException("Unsupported method name: " + method); } } }
@SuppressWarnings("unchecked") Class<EnumClass> enumeration = (Class<EnumClass>) type; EnumStore mode = getAnnotation(configInterface, method, EnumStore.class, true); if (mode != null && EnumStoreMode.ID == mode.value()) { Class<?> idType = getEnumIdType(enumeration);
Class<?> methodType = ConfigUtil.getMethodType(method); try { Stringify stringify = ConfigUtil.getAnnotation(configInterface, method, Stringify.class, true); if (stringify != null) { if ("".equals(stringify.method())) { EnumStore mode = ConfigUtil.getAnnotation(configInterface, method, EnumStore.class, true); if (mode != null && EnumStoreMode.ID == mode.value()) { @SuppressWarnings("unchecked")
returnType = ClassUtils.primitiveToWrapper(returnType); Factory factory = ConfigUtil.getAnnotation(configInterface, method, Factory.class, true); if (factory != null) { try { } else { if (EnumClass.class.isAssignableFrom(returnType)) { EnumStore mode = ConfigUtil.getAnnotation(configInterface, method, EnumStore.class, true); if (mode != null && EnumStoreMode.ID == mode.value()) { @SuppressWarnings("unchecked")