try { Clazz c = analyzer.findClass(typeRef); if (c != null && c.isEnum()) { parseOptionValues(c, ad.options);
try { Clazz c = analyzer.findClass(typeRef); if (c != null && c.isEnum()) { parseOptionValues(c, ad.options);
private boolean acceptableType(String rtype) { TypeRef ref = analyzer.getTypeRef(rtype); try { Clazz returnType = analyzer.findClass(ref); if (returnType.isEnum()) { return true; } // TODO check this is true for interfaces and annotations if (!returnType.isAbstract() || (returnType.isInterface() && options.contains(Options.nested))) { return true; } if (!returnType.isInterface()) { analyzer.error("Abstract classes not allowed as interface method return values: %s", rtype); } else { analyzer.error("Nested metatype only allowed with option: nested type %s", rtype); } return false; } catch (Exception e) { analyzer.exception(e, "could not examine class for return type %s, exception message: %s", rtype, e); return false; } }
private boolean acceptableType(String rtype) { TypeRef ref = analyzer.getTypeRef(rtype); try { Clazz returnType = analyzer.findClass(ref); if (returnType.isEnum()) { return true; } // TODO check this is true for interfaces and annotations if (!returnType.isAbstract() || (returnType.isInterface() && options.contains(Options.nested))) { return true; } if (!returnType.isInterface()) { analyzer.error("Abstract classes not allowed as interface method return values: %s", rtype); } else { analyzer.error("Nested metatype only allowed with option: nested type %s", rtype); } return false; } catch (Exception e) { analyzer.exception(e, "could not examine class for return type %s, exception message: %s", rtype, e); return false; } }
private List<BeanDef> getDefs() throws Exception { if (clazz.isEnum() || clazz.isInterface() || clazz.isAnnotation()) {
private List<BeanDef> getDefs() throws Exception { if (clazz.isEnum() || clazz.isInterface() || clazz.isAnnotation()) {
else type = Type.INTERFACE; else if (clazz.isEnum()) type = Type.ENUM; else
try { Clazz c = analyzer.findClass(typeRef); if (c != null && c.isEnum()) { parseOptionValues(c, ad.options);
try { Clazz c = analyzer.findClass(typeRef); if (c != null && c.isEnum()) { parseOptionValues(c, ad.options);
else type = Type.INTERFACE; else if (clazz.isEnum()) type = Type.ENUM; else
else type = Type.ANNOTATION; else if (clazz.isEnum()) type = Type.ENUM; else
else type = INTERFACE; else if (clazz.isEnum()) type = ENUM; else
else type = INTERFACE; else if (clazz.isEnum()) type = ENUM; else
private ComponentDef getDef() throws Exception { if (clazz.isEnum() || clazz.isInterface() || clazz.isAnnotation()) {
private ComponentDef getDef() throws Exception { if (clazz.isEnum() || clazz.isInterface() || clazz.isAnnotation()) {
if (c != null && c.isEnum()) { optionValues = parseOptionValues(c);
if (c != null && c.isEnum()) { optionValues = parseOptionValues(c);
if (c != null && c.isEnum()) { optionValues = parseOptionValues(c);
if (c != null && c.isEnum()) { optionValues = parseOptionValues(c);
if (c != null && c.isEnum()) { optionValues = parseOptionValues(c);