// Path: restannotations/src/main/java/org/wicketstuff/rest/contenthandling/IObjectSerialDeserial.java
// public interface IObjectSerialDeserial {
// 	/**
// 	 * Write the object in input to the response converting it to a given MIME type.
// 	 * 
// 	 * @param targetObject
// 	 *            the object instance to serialize to string.
// 	 * @param response
// 	 * 			  the response object.	           
// 	 * @param mimeType
// 	 *            the MIME type of the response.
// 	 * @throws Exception 
// 	 */
// 	public void objectToResponse(Object targetObject, WebResponse response, String mimeType) throws Exception;
// 
// 	/**
// 	 * Extract an instance of argClass form the request.
// 	 * 
// 	 * @param request
// 	 * 			the request object.	
// 	 * @param argClass
// 	 * 			the type of the object we want to extract.
// 	 * @param mimeType 
// 	 * 			the MIME type of the request.
// 	 * 
// 	 * @return the object extracted from the request.
// 	 */
// 	public <T> T requestToObject(WebRequest request, Class<T> argClass, String mimeType) throws Exception;
// 	
// 	/**
// 	 * Check if a given MIME type is handled.
// 	 * 
// 	 * @param mimeType
// 	 * 			the MIME type we want to check.
// 	 * @return true if the MIME type is supported, false otherwise.
// 	 */
// 	public boolean isMimeTypeSupported(String mimeType);
// }
// 
// Path: restannotations/src/main/java/org/wicketstuff/rest/contenthandling/RestMimeTypes.java
// public class RestMimeTypes {
// 	public static final String APPLICATION_RSS_XML = "application/rss+xml";
// 
// 	public static final String TEXT_CSS = "text/css";
// 
// 	public static final String TEXT_CSV = "text/csv";
// 
// 	public static final String TEXT_PLAIN = "text/plain";
// 
// 	public static final String TEXT_HTML = "text/html";
// 
// 	public static final String APPLICATION_XML = "application/xml";
// 	
// 	public static final String TEXT_XML = "text/xml";
// 	
// 	public static final String APPLICATION_JSON = "application/json";
// 	
// 	public static final String IMAGE_GIF = "image/gif";
// 	
// 	public static final String IMAGE_JPEG = "image/jpeg";
// 	
// 	public static final String IMAGE_PNG = "image/png";
// 	
// 	public static final String OCTET_STREAM = "application/octet-stream";
// }
// 
// Path: restannotations/src/main/java/org/wicketstuff/rest/utils/http/HttpUtils.java
// public class HttpUtils {
// 	/**
// 	 * Read the string content of the current request.
// 	 * 
// 	 * @param request
// 	 * 			the current request
// 	 * @return
// 	 * 			the string inside body request.
// 	 * @throws IOException
// 	 */
// 	public static String readStringFromRequest(WebRequest request) throws IOException{
// 		HttpServletRequest httpRequest = (HttpServletRequest) request.getContainerRequest();
// 		BufferedReader bufReader = httpRequest.getReader();
// 		StringBuilder builder = new StringBuilder();
// 		String stringLine;
// 
// 		while ((stringLine = bufReader.readLine()) != null)
// 			builder.append(stringLine);
// 		
// 		return builder.toString();
// 	}
// 	
// 	/**
// 	 * Utility method to extract the HTTP request method.
// 	 * 
// 	 * @param request
// 	 *            the current request object
// 	 * @return the HTTP method used for this request
// 	 * @see HttpMethod
// 	 */
// 	public static HttpMethod getHttpMethod(WebRequest request) {
// 		HttpServletRequest httpRequest = (HttpServletRequest) request.getContainerRequest();
// 		return HttpMethod.toHttpMethod((httpRequest.getMethod()));
// 	}
// }


import javax.servlet.ServletResponse;
import org.apache.wicket.request.http.WebRequest;
import org.apache.wicket.request.http.WebResponse;
import org.wicketstuff.rest.contenthandling.IObjectSerialDeserial;
import org.wicketstuff.rest.contenthandling.RestMimeTypes;
import org.wicketstuff.rest.utils.http.HttpUtils;
	 * @return the textual representation of the object.
	 */
	public abstract String objectToString(Object targetObject, String mimeType);

	/**
	 * Extract an object instance from a string value.
	 *
	 * @param <T> the generic type
	 * @param source the source string.
	 * @param targetClass the type of the returned object.
	 * @param mimeType the target MIME type.
	 * @return the extracted object.
	 */
	public abstract <T> T stringToObject(String source, Class<T> targetClass, String mimeType);
	
	/**
	 * Gets the supported charset.
	 *
	 * @return the supported charset
	 */
	public String getCharset() {
		return charset;
	}

	/**
	 * Gets the mime type.
	 *
	 * @return the mime type
	 */
	public String getMimeType() {
// Path: restannotations/src/main/java/org/wicketstuff/rest/contenthandling/IObjectSerialDeserial.java
// public interface IObjectSerialDeserial {
// 	/**
// 	 * Write the object in input to the response converting it to a given MIME type.
// 	 * 
// 	 * @param targetObject
// 	 *            the object instance to serialize to string.
// 	 * @param response
// 	 * 			  the response object.	           
// 	 * @param mimeType
// 	 *            the MIME type of the response.
// 	 * @throws Exception 
// 	 */
// 	public void objectToResponse(Object targetObject, WebResponse response, String mimeType) throws Exception;
// 
// 	/**
// 	 * Extract an instance of argClass form the request.
// 	 * 
// 	 * @param request
// 	 * 			the request object.	
// 	 * @param argClass
// 	 * 			the type of the object we want to extract.
// 	 * @param mimeType 
// 	 * 			the MIME type of the request.
// 	 * 
// 	 * @return the object extracted from the request.
// 	 */
// 	public <T> T requestToObject(WebRequest request, Class<T> argClass, String mimeType) throws Exception;
// 	
// 	/**
// 	 * Check if a given MIME type is handled.
// 	 * 
// 	 * @param mimeType
// 	 * 			the MIME type we want to check.
// 	 * @return true if the MIME type is supported, false otherwise.
// 	 */
// 	public boolean isMimeTypeSupported(String mimeType);
// }
// 
// Path: restannotations/src/main/java/org/wicketstuff/rest/contenthandling/RestMimeTypes.java
// public class RestMimeTypes {
// 	public static final String APPLICATION_RSS_XML = "application/rss+xml";
// 
// 	public static final String TEXT_CSS = "text/css";
// 
// 	public static final String TEXT_CSV = "text/csv";
// 
// 	public static final String TEXT_PLAIN = "text/plain";
// 
// 	public static final String TEXT_HTML = "text/html";
// 
// 	public static final String APPLICATION_XML = "application/xml";
// 	
// 	public static final String TEXT_XML = "text/xml";
// 	
// 	public static final String APPLICATION_JSON = "application/json";
// 	
// 	public static final String IMAGE_GIF = "image/gif";
// 	
// 	public static final String IMAGE_JPEG = "image/jpeg";
// 	
// 	public static final String IMAGE_PNG = "image/png";
// 	
// 	public static final String OCTET_STREAM = "application/octet-stream";
// }
// 
// Path: restannotations/src/main/java/org/wicketstuff/rest/utils/http/HttpUtils.java
// public class HttpUtils {
// 	/**
// 	 * Read the string content of the current request.
// 	 * 
// 	 * @param request
// 	 * 			the current request
// 	 * @return
// 	 * 			the string inside body request.
// 	 * @throws IOException
// 	 */
// 	public static String readStringFromRequest(WebRequest request) throws IOException{
// 		HttpServletRequest httpRequest = (HttpServletRequest) request.getContainerRequest();
// 		BufferedReader bufReader = httpRequest.getReader();
// 		StringBuilder builder = new StringBuilder();
// 		String stringLine;
// 
// 		while ((stringLine = bufReader.readLine()) != null)
// 			builder.append(stringLine);
// 		
// 		return builder.toString();
// 	}
// 	
// 	/**
// 	 * Utility method to extract the HTTP request method.
// 	 * 
// 	 * @param request
// 	 *            the current request object
// 	 * @return the HTTP method used for this request
// 	 * @see HttpMethod
// 	 */
// 	public static HttpMethod getHttpMethod(WebRequest request) {
// 		HttpServletRequest httpRequest = (HttpServletRequest) request.getContainerRequest();
// 		return HttpMethod.toHttpMethod((httpRequest.getMethod()));
// 	}
// }


// Path: restannotations/src/main/java/org/wicketstuff/rest/contenthandling/serialdeserial/TextualObjectSerialDeserial.java
import javax.servlet.ServletResponse;
import org.apache.wicket.request.http.WebRequest;
import org.apache.wicket.request.http.WebResponse;
import org.wicketstuff.rest.contenthandling.IObjectSerialDeserial;
import org.wicketstuff.rest.contenthandling.RestMimeTypes;
import org.wicketstuff.rest.utils.http.HttpUtils;

	 * @return the textual representation of the object.
	 */
	public abstract String objectToString(Object targetObject, String mimeType);

	/**
	 * Extract an object instance from a string value.
	 *
	 * @param <T> the generic type
	 * @param source the source string.
	 * @param targetClass the type of the returned object.
	 * @param mimeType the target MIME type.
	 * @return the extracted object.
	 */
	public abstract <T> T stringToObject(String source, Class<T> targetClass, String mimeType);
	
	/**
	 * Gets the supported charset.
	 *
	 * @return the supported charset
	 */
	public String getCharset() {
		return charset;
	}

	/**
	 * Gets the mime type.
	 *
	 * @return the mime type
	 */
	public String getMimeType() {
		return mimeType;