Java Code Examples for br.com.caelum.vraptor.controller.HttpMethod#values()

The following examples show how to use br.com.caelum.vraptor.controller.HttpMethod#values() . 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: DefaultLogicResult.java    From vraptor4 with Apache License 2.0 5 votes vote down vote up
protected boolean acceptsHttpGet(Method method) {
	if (method.isAnnotationPresent(Get.class)) {
		return true;
	}

	for (HttpMethod httpMethod : HttpMethod.values()) {
		if (method.isAnnotationPresent(httpMethod.getAnnotation())) {
			return false;
		}
	}

	return true;
}
 
Example 2
Source File: PathAnnotationRoutesParser.java    From vraptor4 with Apache License 2.0 5 votes vote down vote up
private EnumSet<HttpMethod> getHttpMethods(AnnotatedElement annotated) {
	EnumSet<HttpMethod> methods = EnumSet.noneOf(HttpMethod.class);
	for (HttpMethod method : HttpMethod.values()) {
		if (annotated.isAnnotationPresent(method.getAnnotation())) {
			methods.add(method);
		}
	}
	return methods;
}