protected void checkBodyParameter() { // annotationParameters中不能有多个body int annotationBodyCount = countRealBodyParameter(methodAnnotationParameters); if (annotationBodyCount > 1) { throw new Error(String.format("too many (%d) body parameter in %s:%s annotation", annotationBodyCount, providerMethod.getDeclaringClass().getName(), providerMethod.getName())); } // providerParameters中不能有多个body int parameterBodyCount = countRealBodyParameter(providerParameters); if (parameterBodyCount > 1) { throw new Error(String.format("too many (%d) body parameter in %s:%s parameters", parameterBodyCount, providerMethod.getDeclaringClass().getName(), providerMethod.getName())); } // annotationParameters和providerParameters不能同时出现body if (annotationBodyCount + parameterBodyCount >= 2) { throw new Error(String.format("not allow both defined body parameter in %s:%s annotation and parameters", providerMethod.getDeclaringClass().getName(), providerMethod.getName())); } }
protected void checkBodyParameter() { // annotationParameters中不能有多个body int annotationBodyCount = countRealBodyParameter(methodAnnotationParameters); if (annotationBodyCount > 1) { throw new Error(String.format("too many (%d) body parameter in %s:%s annotation", annotationBodyCount, providerMethod.getDeclaringClass().getName(), providerMethod.getName())); } // providerParameters中不能有多个body int parameterBodyCount = countRealBodyParameter(providerParameters); if (parameterBodyCount > 1) { throw new Error(String.format("too many (%d) body parameter in %s:%s parameters", parameterBodyCount, providerMethod.getDeclaringClass().getName(), providerMethod.getName())); } // annotationParameters和providerParameters不能同时出现body if (annotationBodyCount + parameterBodyCount >= 2) { throw new Error(String.format("not allow both defined body parameter in %s:%s annotation and parameters", providerMethod.getDeclaringClass().getName(), providerMethod.getName())); } }