// Path: restannotations-examples/src/main/java/org/wicketstuff/rest/domain/PersonPojo.java
// public class PersonPojo {
// 	private String name;
// 	private String email;
// 	private String password;
// 	
// 	public PersonPojo(String name, String email, String password) {
// 		this.name = name;
// 		this.email = email;
// 		this.password = password;
// 	}
// }
// 
// Path: restannotations-json/src/main/java/org/wicketstuff/rest/resource/gson/GsonRestResource.java
// public class GsonRestResource extends AbstractRestResource<GsonSerialDeserial>{
// 	
// 	public GsonRestResource() {
// 		this(new GsonSerialDeserial());
// 	}
// 	
// 	public GsonRestResource(GsonSerialDeserial gsonSerialDeserial) {
// 		super(gsonSerialDeserial);
// 	}
// 
// 	public GsonRestResource(GsonSerialDeserial gsonSerialDeserial, IRoleCheckingStrategy roleCheckingStrategy) {
// 		super(gsonSerialDeserial, roleCheckingStrategy);
// 	}
// }
// 
// Path: restannotations/src/main/java/org/wicketstuff/rest/utils/http/HttpMethod.java
// public enum HttpMethod {
// 	GET("GET"), POST("POST"), HEAD("HEAD"), OPTIONS("OPTIONS"), PUT("PUT"), PATCH("PATCH"), DELETE(
// 			"DELETE"), TRACE("TRACE");
// 
// 	private String method;
// 
// 	private HttpMethod(String method) {
// 		this.method = method;
// 	}
// 
// 	/**
// 	 * Converts a string (like "put", "get", "post", etc...) to the
// 	 * corresponding HTTP method.
// 	 * 
// 	 * @param httpMethod
// 	 *            the string value we want to convert. The conversion mechanism
// 	 *            is case-insensitive.
// 	 * @return
// 	 */
// 	public static HttpMethod toHttpMethod(String httpMethod) {
// 		HttpMethod[] values = HttpMethod.values();
// 		httpMethod = httpMethod.toUpperCase();
// 
// 		for (int i = 0; i < values.length; i++) {
// 			if (values[i].method.equals(httpMethod))
// 				return values[i];
// 		}
// 
// 		throw new RuntimeException("The string value '" + httpMethod
// 				+ "' does not correspond to any valid HTTP request method");
// 	}
// 
// 	public String getMethod() {
// 		return method;
// 	}
// }


import java.util.ArrayList;
import java.util.List;
import org.wicketstuff.rest.annotations.MethodMapping;
import org.wicketstuff.rest.annotations.parameters.RequestBody;
import org.wicketstuff.rest.domain.PersonPojo;
import org.wicketstuff.rest.resource.gson.GsonRestResource;
import org.wicketstuff.rest.utils.http.HttpMethod;
/**
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.wicketstuff.rest.resource;



public class PersonsRestResource extends GsonRestResource {
	private final List<PersonPojo> persons = new ArrayList<PersonPojo>();
	
	public PersonsRestResource(){
		persons.add(new PersonPojo("Freddie Mercury", "fmercury@queen.com", "Eeehooo!"));
		persons.add(new PersonPojo("John Deacon", "jdeacon@queen.com", "bass"));
		persons.add(new PersonPojo("Brian May", "bmay@queen.com", "guitar"));
		persons.add(new PersonPojo("Roger Taylor", "rtaylor@queen.com", "drum"));
	}
	
	@MethodMapping("/persons")
	public List<PersonPojo> getAllPersons() {
		return persons;
	}
	
// Path: restannotations-examples/src/main/java/org/wicketstuff/rest/domain/PersonPojo.java
// public class PersonPojo {
// 	private String name;
// 	private String email;
// 	private String password;
// 	
// 	public PersonPojo(String name, String email, String password) {
// 		this.name = name;
// 		this.email = email;
// 		this.password = password;
// 	}
// }
// 
// Path: restannotations-json/src/main/java/org/wicketstuff/rest/resource/gson/GsonRestResource.java
// public class GsonRestResource extends AbstractRestResource<GsonSerialDeserial>{
// 	
// 	public GsonRestResource() {
// 		this(new GsonSerialDeserial());
// 	}
// 	
// 	public GsonRestResource(GsonSerialDeserial gsonSerialDeserial) {
// 		super(gsonSerialDeserial);
// 	}
// 
// 	public GsonRestResource(GsonSerialDeserial gsonSerialDeserial, IRoleCheckingStrategy roleCheckingStrategy) {
// 		super(gsonSerialDeserial, roleCheckingStrategy);
// 	}
// }
// 
// Path: restannotations/src/main/java/org/wicketstuff/rest/utils/http/HttpMethod.java
// public enum HttpMethod {
// 	GET("GET"), POST("POST"), HEAD("HEAD"), OPTIONS("OPTIONS"), PUT("PUT"), PATCH("PATCH"), DELETE(
// 			"DELETE"), TRACE("TRACE");
// 
// 	private String method;
// 
// 	private HttpMethod(String method) {
// 		this.method = method;
// 	}
// 
// 	/**
// 	 * Converts a string (like "put", "get", "post", etc...) to the
// 	 * corresponding HTTP method.
// 	 * 
// 	 * @param httpMethod
// 	 *            the string value we want to convert. The conversion mechanism
// 	 *            is case-insensitive.
// 	 * @return
// 	 */
// 	public static HttpMethod toHttpMethod(String httpMethod) {
// 		HttpMethod[] values = HttpMethod.values();
// 		httpMethod = httpMethod.toUpperCase();
// 
// 		for (int i = 0; i < values.length; i++) {
// 			if (values[i].method.equals(httpMethod))
// 				return values[i];
// 		}
// 
// 		throw new RuntimeException("The string value '" + httpMethod
// 				+ "' does not correspond to any valid HTTP request method");
// 	}
// 
// 	public String getMethod() {
// 		return method;
// 	}
// }


// Path: restannotations-examples/src/main/java/org/wicketstuff/rest/resource/PersonsRestResource.java
import java.util.ArrayList;
import java.util.List;
import org.wicketstuff.rest.annotations.MethodMapping;
import org.wicketstuff.rest.annotations.parameters.RequestBody;
import org.wicketstuff.rest.domain.PersonPojo;
import org.wicketstuff.rest.resource.gson.GsonRestResource;
import org.wicketstuff.rest.utils.http.HttpMethod;

/**
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.wicketstuff.rest.resource;



public class PersonsRestResource extends GsonRestResource {
	private final List<PersonPojo> persons = new ArrayList<PersonPojo>();
	
	public PersonsRestResource(){
		persons.add(new PersonPojo("Freddie Mercury", "fmercury@queen.com", "Eeehooo!"));
		persons.add(new PersonPojo("John Deacon", "jdeacon@queen.com", "bass"));
		persons.add(new PersonPojo("Brian May", "bmay@queen.com", "guitar"));
		persons.add(new PersonPojo("Roger Taylor", "rtaylor@queen.com", "drum"));
	}
	
	@MethodMapping("/persons")
	public List<PersonPojo> getAllPersons() {
		return persons;
	}
	
	@MethodMapping(value = "/persons/{personIndex}", httpMethod = HttpMethod.DELETE)