/** * Whether this method should be processed as a swagger operation * @return true if this isn't a swagger operation; otherwise, false. */ protected boolean isSkipMethod(Method method) { if (method.getDeclaringClass().getName().equals(Object.class.getName())) { return true; } // skip static method int modifiers = method.getModifiers(); if (Modifier.isStatic(modifiers)) { return true; } ApiOperation apiOperation = method.getAnnotation(ApiOperation.class); if (apiOperation != null && apiOperation.hidden()) { return apiOperation.hidden(); } return !context.canProcess(method); }
private Map<String, Method> retrieveVisibleMethods(Class<?> clazz) { Map<String, Method> visibleMethods = new HashMap<>(); for (Method method : clazz.getMethods()) { String methodName = method.getName(); ApiOperation apiOperationAnnotation = method.getAnnotation(ApiOperation.class); if (apiOperationAnnotation != null) { if (apiOperationAnnotation.hidden()) { continue; } if (StringUtils.isNotEmpty(apiOperationAnnotation.nickname())) { methodName = apiOperationAnnotation.nickname(); } } visibleMethods.put(methodName, method); } return visibleMethods; } }
for (Method method : filteredMethods) { ApiOperation apiOperation = AnnotationUtils.findAnnotation(method, ApiOperation.class); if (apiOperation != null && apiOperation.hidden()) { continue;
if (apiOperation != null && apiOperation.hidden()) { continue;
if (apiOperation.hidden()) { return null;
if (apiOperation.hidden()) { return null;
private Map<String, Method> retrieveVisibleMethods(Class<?> clazz) { Map<String, Method> visibleMethods = new HashMap<>(); for (Method method : clazz.getMethods()) { if (method.isAnnotationPresent(ApiOperation.class) && method.getAnnotation(ApiOperation.class).hidden()) { continue; } visibleMethods.put(method.getName(), method); } return visibleMethods; } }
/** * Whether this method should be processed as a swagger operation * @return true if this isn't a swagger operation; otherwise, false. */ protected boolean isSkipMethod(Method method) { if (method.getDeclaringClass().getName().equals(Object.class.getName())) { return true; } // skip static method int modifiers = method.getModifiers(); if (Modifier.isStatic(modifiers)) { return true; } ApiOperation apiOperation = method.getAnnotation(ApiOperation.class); if (apiOperation != null && apiOperation.hidden()) { return apiOperation.hidden(); } return !context.canProcess(method); }
private Map<String, Method> retrieveVisibleMethods(Class<?> clazz) { Map<String, Method> visibleMethods = new HashMap<>(); for (Method method : clazz.getMethods()) { String methodName = method.getName(); ApiOperation apiOperationAnnotation = method.getAnnotation(ApiOperation.class); if (apiOperationAnnotation != null) { if (apiOperationAnnotation.hidden()) { continue; } if (StringUtils.isNotEmpty(apiOperationAnnotation.nickname())) { methodName = apiOperationAnnotation.nickname(); } } visibleMethods.put(methodName, method); } return visibleMethods; } }
@Override public void apply(OperationContext context) { Optional<ApiOperation> methodAnnotation = context.findAnnotation(ApiOperation.class); if (methodAnnotation.isPresent()) { context.operationBuilder().hidden(methodAnnotation.get().hidden()); } }
rm.value().length > 0 && // has at least 1 URI rm.method().length > 0 && // has at least 1 HttpMethod (apiOp == null || !apiOp.hidden()); // marked as a hidden ApiOperation }).sorted(Comparator.comparing(a -> ((Method)a).getAnnotation(RequestMapping.class).value()[0]) .thenComparing(a -> ((Method)a).getAnnotation(RequestMapping.class).method()[0]))
boolean hidden = apiOperation != null && apiOperation.hidden();
if (apiOperation.hidden()) { return null;
if (apiOperation.hidden()) { return null;
if (apiOperation.hidden()) { return null;
if (apiOperation.hidden()) { return null;
if (apiOperation.hidden()) { return null;