Package ninja.utils
Class AbstractContextImpl
- java.lang.Object
-
- ninja.utils.AbstractContext
-
- ninja.utils.AbstractContextImpl
-
- All Implemented Interfaces:
Context
,Context.Impl
public class AbstractContextImpl extends AbstractContext
Used for mocking an AbstractContext in unit tests.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ninja.Context
Context.HTTP_STATUS, Context.Impl
-
-
Field Summary
-
Fields inherited from class ninja.utils.AbstractContext
bodyParserEngineManager, flashScope, injector, ninjaProperties, paramParsers, route, session, validation
-
Fields inherited from interface ninja.Context
CONTENT_TYPE, NINJA_PROPERTIES_X_FORWARDED_FOR, X_FORWARD_HEADER
-
-
Constructor Summary
Constructors Constructor Description AbstractContextImpl(BodyParserEngineManager bodyParserEngineManager, FlashScope flashScope, NinjaProperties ninjaProperties, Session session, Validation validation, com.google.inject.Injector injector, ParamParsers paramParsers)
-
Method Summary
-
Methods inherited from class ninja.utils.AbstractContext
asyncRequestComplete, finalizeHeaders, finalizeHeaders, finalizeHeadersWithoutFlashAndSessionCookie, getAcceptCharset, getAcceptContentType, getAcceptEncoding, getAcceptLanguage, getAttribute, getContextPath, getCookieValue, getFlashCookie, getFlashScope, getParameter, getParameterAs, getParameterAs, getParameterAsInteger, getParameterAsInteger, getPathParameter, getPathParameterAsInteger, getPathParameterEncoded, getRemoteAddr, getRequestPath, getRoute, getSession, getSessionCookie, getValidation, init, isRequestJson, isRequestXml, parseBody, setRoute, unsetCookie
-
-
-
-
Constructor Detail
-
AbstractContextImpl
public AbstractContextImpl(BodyParserEngineManager bodyParserEngineManager, FlashScope flashScope, NinjaProperties ninjaProperties, Session session, Validation validation, com.google.inject.Injector injector, ParamParsers paramParsers)
-
-
Method Detail
-
getRealRemoteAddr
protected String getRealRemoteAddr()
- Specified by:
getRealRemoteAddr
in classAbstractContext
-
getRequestContentType
public String getRequestContentType()
-
getRequestUri
public String getRequestUri()
-
getRequestParameterString
public String getRequestParameterString()
-
getHostname
public String getHostname()
-
getScheme
public String getScheme()
-
hasCookie
public boolean hasCookie(String cookieName)
-
isAsync
public boolean isAsync()
-
handleAsync
public void handleAsync()
-
returnResultAsync
public void returnResultAsync(Result result)
-
controllerReturned
public Result controllerReturned()
-
getInputStream
public InputStream getInputStream() throws IOException
- Throws:
IOException
-
getReader
public BufferedReader getReader() throws IOException
- Throws:
IOException
-
isMultipart
public boolean isMultipart()
-
getFileItemIterator
public org.apache.commons.fileupload.FileItemIterator getFileItemIterator()
-
getMethod
public String getMethod()
-
addCookie
public void addCookie(Cookie cookie)
-
cleanup
public void cleanup()
-
-