Class JiraWebContext
java.lang.Object
com.atlassian.jira.plugin.webfragment.JiraWebContext
Useful wrapper for web contexts.
Context is normally a map but it contains some standard entries which can be easily retrieved using this class.
All getters return empty if requested object is not set in the context map or has a type different than expected.
- Since:
- v6.5
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic JiraWebContext<T> Optional<T>Returns value assigned to the specified key provided it is present in the map and has the specified type.getI18n()getUser()Tries to figure out the user from context.makeContext(ApplicationUser remoteUser, JiraHelper jiraHelper)
-
Field Details
-
CONTEXT_KEY_USER
- See Also:
-
CONTEXT_KEY_USERNAME
- See Also:
-
CONTEXT_KEY_HELPER
- See Also:
-
CONTEXT_KEY_LOCATION
- See Also:
-
CONTEXT_KEY_I18N
- See Also:
-
-
Method Details
-
from
-
makeContext
-
getUser
Tries to figure out the user from context. It checks the "user" key first and if it does not containApplicationUservalue then tries to load the user based on the "username" key in the context.- Returns:
- user in the context
-
getHelper
-
getI18n
-
getUsername
-
getLocation
-
get
Returns value assigned to the specified key provided it is present in the map and has the specified type.- Type Parameters:
T- expected type- Parameters:
key- entry keytype- expected type- Returns:
- value if present
-