/** * Get whether the pattern matches * * @param name the method name * @param arg the method args * @param iface the interface type * @return true when it matches */ public boolean patternMatches(String name, String[] arg, InvocationType iface) { return methodDelegate.matches(name, arg, BeanMetaData.invocationTypeToMethodInterfaceType(iface)); } /**
/** * Get whether the pattern matches * * @param name the method name * @param arg the method args * @param iface the interface type * @return true when it matches */ public boolean patternMatches(String name, String[] arg, InvocationType iface) { return methodDelegate.matches(name, arg, BeanMetaData.invocationTypeToMethodInterfaceType(iface)); } /**
/** * Whether this matches * * @param methodName the method name * @param params the parameters * @param interfaceType the interface type * @return true when it matches */ public boolean matches(String methodName, String[] params, MethodInterfaceType interfaceType) { if (isEmpty()) return false; for (MethodMetaData method : this) { if (method.matches(methodName, params, interfaceType)) return true; } return false; }
/** * Whether this matches * * @param methodName the method name * @param params the parameters * @param interfaceType the interface type * @return true when it matches */ public boolean matches(String methodName, String[] params, MethodInterfaceType interfaceType) { if (isEmpty()) return false; for (MethodMetaData method : this) { if (method.matches(methodName, params, interfaceType)) return true; } return false; }
/** * Whether this matches * * @param methodName the method name * @param params the parameters * @param interfaceType the interface type * @param bestMatch the previous best match * @return best match */ public MethodMetaData bestMatch(String methodName, String[] params, MethodInterfaceType interfaceType, MethodMetaData bestMatch) { if (isEmpty()) return bestMatch; for (MethodMetaData method : this) { if (method.matches(methodName, params, interfaceType)) { // No previous best match if (bestMatch == null) bestMatch = method; // better match because the previous was a wildcard else if ("*".equals(bestMatch.getMethodName())) bestMatch = method; // better because it specifies parameters else if (method.getMethodParams() != null) bestMatch = method; } } return bestMatch; }
/** * Whether this matches * * @param methodName the method name * @param params the parameters * @param interfaceType the interface type * @param bestMatch the previous best match * @return best match */ public MethodMetaData bestMatch(String methodName, String[] params, MethodInterfaceType interfaceType, MethodMetaData bestMatch) { if (isEmpty()) return bestMatch; for (MethodMetaData method : this) { if (method.matches(methodName, params, interfaceType)) { // No previous best match if (bestMatch == null) bestMatch = method; // better match because the previous was a wildcard else if ("*".equals(bestMatch.getMethodName())) bestMatch = method; // better because it specifies parameters else if (method.getMethodParams() != null) bestMatch = method; } } return bestMatch; }