com.atlassian.jira.issue.customfields.converters
Class UserConverterImpl

java.lang.Object
  extended by com.atlassian.jira.issue.customfields.converters.UserConverterImpl
All Implemented Interfaces:
UserConverter
Direct Known Subclasses:
MultiUserConverterImpl

public class UserConverterImpl
extends Object
implements UserConverter


Constructor Summary
UserConverterImpl(UserManager userManager)
           
 
Method Summary
 String getDbString(ApplicationUser user)
          Get the String representation of the User to be passed to and from the database tier.
 String getHttpParameterValue(ApplicationUser user)
          Get the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.
 String getString(com.atlassian.crowd.embedded.api.User user)
          Get the String representation of the User.
 com.atlassian.crowd.embedded.api.User getUser(String stringValue)
          Get the User Object from the user name.
 com.atlassian.crowd.embedded.api.User getUserEvenWhenUnknown(String stringValue)
          Get the User Object from the user name even when the user is unknown.
 ApplicationUser getUserFromDbString(String stringValue)
          Get the User Object from its database string representation.
 ApplicationUser getUserFromHttpParameterWithValidation(String stringValue)
          Get the User Object from its presentation string representation.
 com.atlassian.crowd.embedded.api.User getUserObject(String stringValue)
          Get the User Object from the user name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserConverterImpl

public UserConverterImpl(UserManager userManager)
Method Detail

getString

public String getString(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: UserConverter
Get the String representation of the User.

Specified by:
getString in interface UserConverter
Parameters:
user - the User
Returns:
the String representation of the User

getHttpParameterValue

public String getHttpParameterValue(ApplicationUser user)
Description copied from interface: UserConverter
Get the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.

Specified by:
getHttpParameterValue in interface UserConverter
Parameters:
user - the User
Returns:
the String representation of the User to be passed to and from the presentation tier as an HTTP parameter.

getDbString

public String getDbString(ApplicationUser user)
Description copied from interface: UserConverter
Get the String representation of the User to be passed to and from the database tier.

Specified by:
getDbString in interface UserConverter
Parameters:
user - the User
Returns:
the String representation of the User to be passed to and from the database tier.

getUser

public com.atlassian.crowd.embedded.api.User getUser(String stringValue)
                                              throws FieldValidationException
Description copied from interface: UserConverter
Get the User Object from the user name. This will return null if the stringValue is empty.

Specified by:
getUser in interface UserConverter
Parameters:
stringValue - User name
Returns:
A User or null if the input parameter is empty
Throws:
FieldValidationException - if the input parameter is null

getUserEvenWhenUnknown

public com.atlassian.crowd.embedded.api.User getUserEvenWhenUnknown(String stringValue)
                                                             throws FieldValidationException
Description copied from interface: UserConverter
Get the User Object from the user name even when the user is unknown. This is usefull in places where the user needs to be shown, even though they may have disappeared remotely, say from LDAP. This will return null if the stringValue is empty.

Specified by:
getUserEvenWhenUnknown in interface UserConverter
Parameters:
stringValue - User name
Returns:
A User or null if the input parameter is empty
Throws:
FieldValidationException - if the input parameter is null

getUserFromHttpParameterWithValidation

public ApplicationUser getUserFromHttpParameterWithValidation(String stringValue)
                                                       throws FieldValidationException
Description copied from interface: UserConverter
Get the User Object from its presentation string representation. This will return null if the stringValue is empty.

Specified by:
getUserFromHttpParameterWithValidation in interface UserConverter
Parameters:
stringValue - presentation string representation (username)
Returns:
An ApplicationUser (or null if the input parameter is empty)
Throws:
FieldValidationException - if no user exists with the given username
See Also:
#getHttpParameterValue(ApplicationUser)}

getUserFromDbString

public ApplicationUser getUserFromDbString(String stringValue)
Description copied from interface: UserConverter
Get the User Object from its database string representation. If a null stringValue is passed, then a null User object is returned, but it is guaranteed to return a non-null User in all other cases. This is usefull in places where the user needs to be shown, even though they may have disappeared remotely, say from LDAP.

Specified by:
getUserFromDbString in interface UserConverter
Parameters:
stringValue - database string representation
Returns:
A User or null if the input parameter is empty
See Also:
#getDbString(ApplicationUser)}

getUserObject

public com.atlassian.crowd.embedded.api.User getUserObject(String stringValue)
                                                    throws FieldValidationException
Description copied from interface: UserConverter
Get the User Object from the user name. This will return null if the stringValue is empty.

Specified by:
getUserObject in interface UserConverter
Parameters:
stringValue - User name
Returns:
A User or null if the input parameter is empty
Throws:
FieldValidationException - if the input parameter is null


Copyright © 2002-2013 Atlassian. All Rights Reserved.