Uses of Interface
ninja.Context
-
Packages that use Context Package Description ninja ninja.bodyparser ninja.diagnostics ninja.i18n ninja.params ninja.session ninja.template ninja.template.directives ninja.utils ninja.validation ninja.websockets -
-
Uses of Context in ninja
Subinterfaces of Context in ninja Modifier and Type Interface Description static interface
Context.Impl
Impl is used to hide stuff that a user should not see on code completion.Classes in ninja that implement Context Modifier and Type Class Description class
WrappedContext
A wrapped context.Methods in ninja with parameters of type Context Modifier and Type Method Description ReverseRouter.Builder
ReverseRouter.Builder. absolute(Context context)
Make this an absolute route by including the current scheme (e.g.protected Message
NinjaDefault. buildErrorMessage(Context context, String errorTextKey, String errorTextDefault, Optional<Throwable> exception, Optional<Result> underlyingResult)
Result
AuthenticityFilter. filter(FilterChain filterChain, Context context)
Result
BasicAuthFilter. filter(FilterChain chain, Context context)
Result
Filter. filter(FilterChain filterChain, Context context)
Filter the request.Result
SecureFilter. filter(FilterChain chain, Context context)
Result
Ninja. getBadRequestResult(Context context, BadRequestException exception)
Should handle cases where the client sent strange date that led to an error.Result
NinjaDefault. getBadRequestResult(Context context, BadRequestException exception)
Result
Ninja. getForbiddenResult(Context context)
Should handle cases where access is forbidden Should lead to a html error 403 - forbidden (and be used with the same mindset).Result
Ninja. getForbiddenResult(Context context, ForbiddenRequestException exception)
Should handle cases where access is forbidden Should lead to a html error 403 - forbidden (and be used with the same mindset).Result
NinjaDefault. getForbiddenResult(Context context)
Result
NinjaDefault. getForbiddenResult(Context context, ForbiddenRequestException exception)
Result
Ninja. getInternalServerErrorResult(Context context, Exception exception, Result underlyingResult)
Should handle cases where an exception is thrown when handling a route that let to an internal server error.Result
NinjaDefault. getInternalServerErrorResult(Context context, Exception exception)
Deprecated.Result
NinjaDefault. getInternalServerErrorResult(Context context, Exception exception, Result underlyingResult)
Result
Ninja. getNotFoundResult(Context context)
Should handle cases where no route can be found for a given request.Result
Ninja. getNotFoundResult(Context context, RequestNotFoundException exception)
Should handle cases where no route can be found for a given request.Result
NinjaDefault. getNotFoundResult(Context context)
Result
NinjaDefault. getNotFoundResult(Context context, RequestNotFoundException exception)
Result
Ninja. getRenderingExceptionResult(Context context, RenderingException exception, Result underlyingResult)
Should handle cases where aRenderingException
is thrown when handling the rendering of a Result.Result
NinjaDefault. getRenderingExceptionResult(Context context, RenderingException exception, Result underlyingResult)
Result
Ninja. getUnauthorizedResult(Context context)
Should handle cases where access is unauthorized Should lead to a html error 401 - unauthorized (and be used with the same mindset).Result
NinjaDefault. getUnauthorizedResult(Context context)
Result
FilterChain. next(Context context)
Pass the request to the next filterResult
Ninja. onException(Context context, Exception exception)
This result should be used when an error occurs.Result
NinjaDefault. onException(Context context, Exception exception)
Result
NinjaDefault. onException(Context context, Exception exception, Result underlyingResult)
void
Renderable. render(Context context, Result result)
void
Ninja. renderErrorResultAndCatchAndLogExceptions(Result result, Context context)
Should be used to render an error.void
NinjaDefault. renderErrorResultAndCatchAndLogExceptions(Result result, Context context)
Constructors in ninja with parameters of type Context Constructor Description WrappedContext(Context wrapped)
-
Uses of Context in ninja.bodyparser
Methods in ninja.bodyparser with parameters of type Context Modifier and Type Method Description <T> T
BodyParserEngine. invoke(Context context, Class<T> classOfT)
Invoke the parser and get back a Java object populated with the content of this request.<T> T
BodyParserEngineJson. invoke(Context context, Class<T> classOfT)
<T> T
BodyParserEnginePost. invoke(Context context, Class<T> classOfT)
<T> T
BodyParserEngineXml. invoke(Context context, Class<T> classOfT)
-
Uses of Context in ninja.diagnostics
Methods in ninja.diagnostics with parameters of type Context Modifier and Type Method Description static DiagnosticErrorRenderer
DiagnosticErrorRenderer. build(Context context, Result result, DiagnosticError diagnosticError)
void
DiagnosticError. render(Context context, Result result)
void
DiagnosticErrorRenderer. renderResult(Context context, Result result)
static void
DiagnosticErrorRenderer. tryToRender(Context context, Result result, DiagnosticError diagnosticError, boolean throwInternalServerExceptionOnError)
-
Uses of Context in ninja.i18n
Methods in ninja.i18n with parameters of type Context Modifier and Type Method Description Optional<String>
Messages. get(String key, Context context, Optional<Result> result, Object... parameter)
Get a translated string.Optional<String>
MessagesImpl. get(String key, Context context, Optional<Result> result, Object... parameter)
Map<Object,Object>
Messages. getAll(Context context, Optional<Result> result)
Returns all messages for the default language in that context / result.Map<Object,Object>
MessagesImpl. getAll(Context context, Optional<Result> result)
Optional<String>
Lang. getLanguage(Context context, Optional<Result> result)
Retrieve the current language or null if not set.Optional<String>
LangImpl. getLanguage(Context context, Optional<Result> result)
String
Messages. getWithDefault(String key, String defaultMessage, Context context, Optional<Result> result, Object... params)
Gets a message for a message key.String
MessagesImpl. getWithDefault(String key, String defaultMessage, Context context, Optional<Result> result, Object... params)
-
Uses of Context in ninja.params
Methods in ninja.params that return Context Modifier and Type Method Description Context
ArgumentExtractors.ContextExtractor. extract(Context context)
Methods in ninja.params that return types with arguments of type Context Modifier and Type Method Description Class<Context>
ArgumentExtractors.ContextExtractor. getExtractedType()
Methods in ninja.params with parameters of type Context Modifier and Type Method Description T
ArgumentExtractor. extract(Context context)
Extract the argument from the contextObject
ArgumentExtractors.AttributeExtractor. extract(Context context)
T
ArgumentExtractors.BodyAsExtractor. extract(Context context)
Context
ArgumentExtractors.ContextExtractor. extract(Context context)
FileItem
ArgumentExtractors.FileItemParamExtractor. extract(Context context)
FileItem[]
ArgumentExtractors.FileItemParamsExtractor. extract(Context context)
File
ArgumentExtractors.FileParamExtractor. extract(Context context)
File[]
ArgumentExtractors.FileParamsExtractor. extract(Context context)
FlashScope
ArgumentExtractors.FlashExtractor. extract(Context context)
String
ArgumentExtractors.HeaderExtractor. extract(Context context)
String[]
ArgumentExtractors.HeadersExtractor. extract(Context context)
InputStream
ArgumentExtractors.InputStreamParamExtractor. extract(Context context)
InputStream[]
ArgumentExtractors.InputStreamParamsExtractor. extract(Context context)
String
ArgumentExtractors.ParamExtractor. extract(Context context)
String[]
ArgumentExtractors.ParamsExtractor. extract(Context context)
String
ArgumentExtractors.PathParamExtractor. extract(Context context)
Session
ArgumentExtractors.SessionExtractor. extract(Context context)
String
ArgumentExtractors.SessionParamExtractor. extract(Context context)
Validation
ArgumentExtractors.ValidationExtractor. extract(Context context)
T
ParsingArgumentExtractor. extract(Context context)
X
ParsingArrayExtractor. extract(Context context)
T
ValidatingArgumentExtractor. extract(Context context)
Object
ControllerMethodInvoker. invoke(Object controller, Context context)
-
Uses of Context in ninja.session
Methods in ninja.session with parameters of type Context Modifier and Type Method Description void
FlashScope. init(Context context)
Intended for use by implementations only.void
FlashScopeImpl. init(Context context)
void
Session. init(Context context)
Has to be called initially.void
SessionImpl. init(Context context)
void
FlashScope. save(Context context)
Intended for use by implementations only.void
FlashScopeImpl. save(Context context)
void
Session. save(Context context)
To finally send this session to the user this method has to be called.void
SessionImpl. save(Context context)
-
Uses of Context in ninja.template
Methods in ninja.template with parameters of type Context Modifier and Type Method Description void
TemplateEngine. invoke(Context context, Result result)
Render the given object to the given contextvoid
TemplateEngineFreemarker. invoke(Context context, Result result)
void
TemplateEngineJson. invoke(Context context, Result result)
void
TemplateEngineJsonP. invoke(Context context, Result result)
void
TemplateEngineText. invoke(Context context, Result result)
void
TemplateEngineXml. invoke(Context context, Result result)
void
TemplateEngineFreemarker. throwRenderingException(Context context, Result result, Exception cause, String knownTemplateSourcePath)
Constructors in ninja.template with parameters of type Context Constructor Description TemplateEngineFreemarkerI18nMethod(Messages messages, Context context, Result result)
-
Uses of Context in ninja.template.directives
Constructors in ninja.template.directives with parameters of type Context Constructor Description TemplateEngineFreemarkerAuthenticityFormDirective(Context context)
TemplateEngineFreemarkerAuthenticityTokenDirective(Context context)
-
Uses of Context in ninja.utils
Classes in ninja.utils that implement Context Modifier and Type Class Description class
AbstractContext
Abstract Context.Impl that implements features that are not reliant on the concrete Context implementation.Methods in ninja.utils with parameters of type Context Modifier and Type Method Description void
HttpCacheToolkit. addEtag(Context context, Result result, Long lastModified)
Adds etag to result.void
HttpCacheToolkitImpl. addEtag(Context context, Result result, Long lastModified)
String
MimeTypes. getContentType(Context context, String filename)
return the content-type from a file name.String
MimeTypes. getContentType(Context context, String filename, String defaultContentType)
return the content-type from a file name.
For a text-based content-type, also return the encoding suffix eg.void
ResultHandler. handleResult(Result result, Context context)
boolean
HttpCacheToolkit. isModified(Optional<String> etag, Optional<Long> lastModified, Context context)
Checks if resource has been modified.boolean
HttpCacheToolkitImpl. isModified(Optional<String> etag, Optional<Long> lastModified, Context context)
-
Uses of Context in ninja.validation
Methods in ninja.validation with parameters of type Context Modifier and Type Method Description void
Validator. validate(T value, String field, Context context)
Validate the given valuevoid
Validators.DateValidator. validate(String value, String field, Context context)
Validate the given valuevoid
Validators.EnumValidator. validate(String value, String field, Context context)
Validate the given valuevoid
Validators.FloatValidator. validate(String value, String field, Context context)
Validate the given valuevoid
Validators.IntegerValidator. validate(String value, String field, Context context)
Validate the given valuevoid
Validators.JSRValidator. validate(Object value, String field, Context context)
Validate the given value.void
Validators.LengthValidator. validate(String value, String field, Context context)
Validate the given valuevoid
Validators.MatchesValidator. validate(String value, String field, Context context)
Validate the given valuevoid
Validators.NumberValidator. validate(Number value, String field, Context context)
Validate the given valuevoid
Validators.RequiredValidator. validate(Object value, String field, Context context)
void
Validators.UUIDValidator. validate(String value, String field, Context context)
Validate the given value -
Uses of Context in ninja.websockets
Methods in ninja.websockets with parameters of type Context Modifier and Type Method Description WebSocketHandshake
WebSocketHandshakeExtractor. extract(Context context)
-