Java Code Examples for org.springframework.web.bind.annotation.DeleteMapping#name()

The following examples show how to use org.springframework.web.bind.annotation.DeleteMapping#name() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultEndPointPlugin.java    From BlogManagePlatform with Apache License 2.0 5 votes vote down vote up
private String resolveApiName(OperationContext context) {
	Api api = context.findControllerAnnotation(Api.class).orNull();
	if (api != null) {
		return api.tags()[0];
	}
	GetMapping getMapping = context.findControllerAnnotation(GetMapping.class).orNull();
	if (getMapping != null) {
		return getMapping.name();
	}
	PostMapping postMapping = context.findControllerAnnotation(PostMapping.class).orNull();
	if (postMapping != null) {
		return postMapping.name();
	}
	DeleteMapping deleteMapping = context.findControllerAnnotation(DeleteMapping.class).orNull();
	if (deleteMapping != null) {
		return deleteMapping.name();
	}
	PutMapping putMapping = context.findControllerAnnotation(PutMapping.class).orNull();
	if (putMapping != null) {
		return putMapping.name();
	}
	RequestMapping requestMapping = context.findControllerAnnotation(RequestMapping.class).orNull();
	if (requestMapping != null) {
		return requestMapping.name();
	}
	return "";
}
 
Example 2
Source File: DefaultControllerPlugin.java    From BlogManagePlatform with Apache License 2.0 5 votes vote down vote up
private ControllerInfo resolveNameAttribute(Class<?> controller) {
	ControllerInfo info = new ControllerInfo();
	boolean isRestController = isRestController(controller);
	GetMapping getMapping = findAnnotation(controller, GetMapping.class);
	if (getMapping != null) {
		info.name = getMapping.name();
		info.consumes = getMapping.consumes();
		info.produces = resolveJsonInfo(isRestController, getMapping.produces());
		return info;
	}
	PostMapping postMapping = findAnnotation(controller, PostMapping.class);
	if (postMapping != null) {
		info.name = postMapping.name();
		info.consumes = postMapping.consumes();
		info.produces = resolveJsonInfo(isRestController, postMapping.produces());
		return info;
	}
	DeleteMapping deleteMapping = findAnnotation(controller, DeleteMapping.class);
	if (deleteMapping != null) {
		info.name = deleteMapping.name();
		info.consumes = deleteMapping.consumes();
		info.produces = resolveJsonInfo(isRestController, deleteMapping.produces());
		return info;
	}
	PutMapping putMapping = findAnnotation(controller, PutMapping.class);
	if (putMapping != null) {
		info.name = putMapping.name();
		info.consumes = putMapping.consumes();
		info.produces = resolveJsonInfo(isRestController, putMapping.produces());
		return info;
	}
	RequestMapping requestMapping = findAnnotation(controller, RequestMapping.class);
	if (requestMapping != null) {
		info.name = requestMapping.name();
		info.consumes = requestMapping.consumes();
		info.produces = resolveJsonInfo(isRestController, requestMapping.produces());
		return info;
	}
	return null;
}
 
Example 3
Source File: DefaultEndPointPlugin.java    From BlogManagePlatform with Apache License 2.0 4 votes vote down vote up
private EndPointInfo resolveNameAttribute(OperationContext context) {
	EndPointInfo info = new EndPointInfo();
	info.controllerName = resolveApiName(context);
	boolean isRestEndPoint = isRestEndPoint(context);
	GetMapping getMapping = context.findAnnotation(GetMapping.class).orNull();
	if (getMapping != null) {
		info.name = getMapping.name();
		info.consumes = getMapping.consumes();
		info.produces = resolveJsonInfo(isRestEndPoint, getMapping.produces());
		return info;
	}
	PostMapping postMapping = context.findAnnotation(PostMapping.class).orNull();
	if (postMapping != null) {
		info.name = postMapping.name();
		info.consumes = postMapping.consumes();
		info.produces = resolveJsonInfo(isRestEndPoint, postMapping.produces());
		return info;
	}
	DeleteMapping deleteMapping = context.findAnnotation(DeleteMapping.class).orNull();
	if (deleteMapping != null) {
		info.name = deleteMapping.name();
		info.consumes = deleteMapping.consumes();
		info.produces = resolveJsonInfo(isRestEndPoint, deleteMapping.produces());
		return info;
	}
	PutMapping putMapping = context.findAnnotation(PutMapping.class).orNull();
	if (putMapping != null) {
		info.name = putMapping.name();
		info.consumes = putMapping.consumes();
		info.produces = resolveJsonInfo(isRestEndPoint, putMapping.produces());
		return info;
	}
	RequestMapping requestMapping = context.findAnnotation(RequestMapping.class).orNull();
	if (requestMapping != null) {
		info.name = requestMapping.name();
		info.consumes = requestMapping.consumes();
		info.produces = resolveJsonInfo(isRestEndPoint, requestMapping.produces());
		return info;
	}
	return null;
}