public static boolean isApplicable(Method method, Property property) { return isApplicable(method, property, false); }
public static boolean has(TypeDef clazz, Property property) { for (Method method : clazz.getMethods()) { if (isApplicable(method, property)) { return true; } } return false; }
public static boolean hasOrInherits(TypeDef clazz, Property property) { TypeDef current = clazz; //Iterate parent objects and check for properties with setters but not ctor arguments. while (current!= null && !current.equals(TypeDef.OBJECT)) { for (Method method : current.getMethods()) { if (isApplicable(method, property)) { return true; } } if (!current.getExtendsList().isEmpty()) { String fqn = current.getExtendsList().iterator().next().getDefinition().getFullyQualifiedName(); current = DefinitionRepository.getRepository().getDefinition(fqn); } else { current = null; } } return false; } }