@Override protected ItdTypeDetailsProvidingMetadataItem getMetadata( final String metadataIdentificationString, final JavaType aspectName, final PhysicalTypeMetadata governorPhysicalTypeMetadata, final String itdFilename) { // Get controller JavaType from @RooLinkFactory LinkFactoryAnnotationValues annotationValues = new LinkFactoryAnnotationValues(governorPhysicalTypeMetadata); JavaType controller = annotationValues.getController(); // Check if it is a valid controller ClassOrInterfaceTypeDetails controllerDetails = getTypeLocationService().getTypeDetails(controller); // Get ControllerMetadata to get info from it String controllerMetadataKey = ControllerMetadata.createIdentifier(controllerDetails); final ControllerMetadata controllerMetadata = getMetadataService().get(controllerMetadataKey); // Get the controller methods List<MethodMetadata> controllerMethods = new ArrayList<MethodMetadata>(); MemberDetails controllerMemberDetails = getMemberDetails(controllerDetails); for (MethodMetadata method : controllerMemberDetails.getMethods()) { // Check if is a @RequestMapping method if (method.getAnnotation(SpringJavaType.GET_MAPPING) != null || method.getAnnotation(SpringJavaType.POST_MAPPING) != null || method.getAnnotation(SpringJavaType.PUT_MAPPING) != null || method.getAnnotation(SpringJavaType.DELETE_MAPPING) != null || method.getAnnotation(SpringJavaType.REQUEST_MAPPING) != null) { controllerMethods.add(method); } } return new LinkFactoryMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, controller, controllerMetadata, controllerMethods); }
definedMethod.getAnnotation(SpringJavaType.REQUEST_MAPPING);
@Override protected ItdTypeDetailsProvidingMetadataItem getMetadata( final String metadataIdentificationString, final JavaType aspectName, final PhysicalTypeMetadata governorPhysicalTypeMetadata, final String itdFilename) { // Get controller JavaType from @RooLinkFactory LinkFactoryAnnotationValues annotationValues = new LinkFactoryAnnotationValues(governorPhysicalTypeMetadata); JavaType controller = annotationValues.getController(); // Check if it is a valid controller ClassOrInterfaceTypeDetails controllerDetails = getTypeLocationService().getTypeDetails(controller); // Get ControllerMetadata to get info from it String controllerMetadataKey = ControllerMetadata.createIdentifier(controllerDetails); final ControllerMetadata controllerMetadata = getMetadataService().get(controllerMetadataKey); // Get the controller methods List<MethodMetadata> controllerMethods = new ArrayList<MethodMetadata>(); MemberDetails controllerMemberDetails = getMemberDetails(controllerDetails); for (MethodMetadata method : controllerMemberDetails.getMethods()) { // Check if is a @RequestMapping method if (method.getAnnotation(SpringJavaType.GET_MAPPING) != null || method.getAnnotation(SpringJavaType.POST_MAPPING) != null || method.getAnnotation(SpringJavaType.PUT_MAPPING) != null || method.getAnnotation(SpringJavaType.DELETE_MAPPING) != null || method.getAnnotation(SpringJavaType.REQUEST_MAPPING) != null) { controllerMethods.add(method); } } return new LinkFactoryMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, controller, controllerMetadata, controllerMethods); }