|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.util.UserContext
public class UserContext
Used to store contextual values relatives to the user (in a web context, there is one UserContext per http session).
Field Summary | |
---|---|
private java.lang.String |
error
last error message |
private java.util.Map<Entity,java.lang.Long> |
lastInsertedIDs
map of last inserted IDs |
private java.util.Locale |
locale
locale |
private Localizer |
localizer
localizer |
static java.lang.String |
USER_CONTEXT_KEY
key used to store the user context in the http session. |
private java.util.List<java.lang.String> |
validationErrors
list of validation error messages |
Constructor Summary | |
---|---|
UserContext()
Constructor. |
Method Summary | |
---|---|
void |
addValidationError(java.lang.String err)
Add a validation error. |
void |
clearValidationErrors()
Clear validation errors. |
java.lang.Object |
get(java.lang.String key)
generic getter. |
java.lang.String |
getError()
Last error getter. |
long |
getLastInsertedID(Entity entity)
Get the last inserted ID for an entity. |
java.util.Locale |
getLocale()
Locale getter. |
java.util.List<java.lang.String> |
getValidationErrors()
Get all validation error messages. |
java.lang.String |
localize(java.lang.String str,
java.lang.Object... params)
Localize a parameterized message. |
void |
setError(java.lang.String err)
Last error setter. |
void |
setLastInsertedID(Entity entity,
long id)
Set the last inserted ID for an entity. |
void |
setLocale(java.util.Locale loc)
Locale setter. |
void |
setLocalizer(Localizer loc)
Localizer setter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USER_CONTEXT_KEY
private java.lang.String error
private java.util.List<java.lang.String> validationErrors
private Localizer localizer
private java.util.Locale locale
private java.util.Map<Entity,java.lang.Long> lastInsertedIDs
Constructor Detail |
---|
public UserContext()
Method Detail |
---|
public void setError(java.lang.String err)
err
- errorpublic java.lang.String getError()
public void setLocalizer(Localizer loc)
loc
- localizerpublic void setLocale(java.util.Locale loc)
loc
- Localepublic java.lang.String localize(java.lang.String str, java.lang.Object... params)
str
- message to localizeparams
- parameters that are meant to replace "{0}", "{1}", ... in the message
public void clearValidationErrors()
public void addValidationError(java.lang.String err)
err
- validation errorpublic java.util.List<java.lang.String> getValidationErrors()
public java.lang.Object get(java.lang.String key)
public java.util.Locale getLocale()
public void setLastInsertedID(Entity entity, long id)
entity
- entityid
- last inserted idpublic long getLastInsertedID(Entity entity)
entity
- entity
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |