All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jwebmp.guicedservlets.GuicedServletKeys Maven / Gradle / Ivy

There is a newer version: 0.68.0.1
Show newest version
package com.jwebmp.guicedservlets;

import com.google.inject.Key;

import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Keys holder for Guice Servlet items - Exists purely to override in test cases
 */
@SuppressWarnings({"unused", "WeakerAccess"})
public class GuicedServletKeys
{
	/**
	 * The key to get the servlet context
	 */
	private static Key ServletContextKey;
	/**
	 * The key to get the servlet request
	 */
	private static Key HttpServletRequestKey;
	/**
	 * The key to get the servlet response
	 */
	private static Key HttpServletResponseKey;
	/**
	 * The key to get the session
	 */
	private static Key HttpSessionKey;
	/**
	 * The key to get the servlet request
	 */
	private static Key ServletRequestKey;
	/**
	 * The key to get the servlet response
	 */
	private static Key ServletResponseKey;

	/**
	 * Does nothing but instantiate
	 */
	public GuicedServletKeys()
	{
		//No config required
	}

	/**
	 * Method getServletContextKey returns the ServletContextKey of this GuicedServletKeys object.
	 * 

* The key to get the servlet context * * @return the ServletContextKey (type Key ServletContext ) of this GuicedServletKeys object. */ public static Key getServletContextKey() { return GuicedServletKeys.ServletContextKey; } /** * Method setServletContextKey sets the ServletContextKey of this GuicedServletKeys object. *

* The key to get the servlet context * * @param servletContextKey * the ServletContextKey of this GuicedServletKeys object. */ public static void setServletContextKey(Key servletContextKey) { GuicedServletKeys.ServletContextKey = servletContextKey; } /** * Method getHttpServletRequestKey returns the HttpServletRequestKey of this GuicedServletKeys object. *

* The key to get the servlet request * * @return the HttpServletRequestKey (type Key HttpServletRequest ) of this GuicedServletKeys object. */ public static Key getHttpServletRequestKey() { return GuicedServletKeys.HttpServletRequestKey; } /** * Method setHttpServletRequestKey sets the HttpServletRequestKey of this GuicedServletKeys object. *

* The key to get the servlet request * * @param httpServletRequestKey * the HttpServletRequestKey of this GuicedServletKeys object. */ public static void setHttpServletRequestKey(Key httpServletRequestKey) { GuicedServletKeys.HttpServletRequestKey = httpServletRequestKey; } /** * Method getHttpServletResponseKey returns the HttpServletResponseKey of this GuicedServletKeys object. *

* The key to get the servlet response * * @return the HttpServletResponseKey (type Key HttpServletResponse ) of this GuicedServletKeys object. */ public static Key getHttpServletResponseKey() { return GuicedServletKeys.HttpServletResponseKey; } /** * Method setHttpServletResponseKey sets the HttpServletResponseKey of this GuicedServletKeys object. *

* The key to get the servlet response * * @param httpServletResponseKey * the HttpServletResponseKey of this GuicedServletKeys object. */ public static void setHttpServletResponseKey(Key httpServletResponseKey) { GuicedServletKeys.HttpServletResponseKey = httpServletResponseKey; } /** * Method getHttpSessionKey returns the HttpSessionKey of this GuicedServletKeys object. *

* The key to get the session * * @return the HttpSessionKey (type Key HttpSession ) of this GuicedServletKeys object. */ public static Key getHttpSessionKey() { return GuicedServletKeys.HttpSessionKey; } /** * Method setHttpSessionKey sets the HttpSessionKey of this GuicedServletKeys object. *

* The key to get the session * * @param httpSessionKey * the HttpSessionKey of this GuicedServletKeys object. */ public static void setHttpSessionKey(Key httpSessionKey) { GuicedServletKeys.HttpSessionKey = httpSessionKey; } /** * Method getServletRequestKey returns the ServletRequestKey of this GuicedServletKeys object. *

* The key to get the servlet request * * @return the ServletRequestKey (type Key ServletRequest ) of this GuicedServletKeys object. */ public static Key getServletRequestKey() { return GuicedServletKeys.ServletRequestKey; } /** * Method setServletRequestKey sets the ServletRequestKey of this GuicedServletKeys object. *

* The key to get the servlet request * * @param servletRequestKey * the ServletRequestKey of this GuicedServletKeys object. */ public static void setServletRequestKey(Key servletRequestKey) { GuicedServletKeys.ServletRequestKey = servletRequestKey; } /** * Method getServletResponseKey returns the ServletResponseKey of this GuicedServletKeys object. *

* The key to get the servlet response * * @return the ServletResponseKey (type Key ServletResponse ) of this GuicedServletKeys object. */ public static Key getServletResponseKey() { return GuicedServletKeys.ServletResponseKey; } /** * Method setServletResponseKey sets the ServletResponseKey of this GuicedServletKeys object. *

* The key to get the servlet response * * @param servletResponseKey * the ServletResponseKey of this GuicedServletKeys object. */ public static void setServletResponseKey(Key servletResponseKey) { GuicedServletKeys.ServletResponseKey = servletResponseKey; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy