|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.servlet.user.Username
public class Username
Allows us to require a valid username as a parameter without having to do the checking ourselves.
| Field Summary | |
|---|---|
protected String |
_username
|
static int |
MAXIMUM_USERNAME_LENGTH
The maximum allowable length of a username. |
static int |
MINIMUM_USERNAME_LENGTH
The minimum allowable length of a username. |
static String |
NAME_REGEX
The regular expression defining valid names. |
| Constructor Summary | |
|---|---|
Username(String username)
Creates a username instance. |
|
| Method Summary | |
|---|---|
String |
getUsername()
Returns the text of this username. |
String |
toString()
|
protected void |
validateName(String username)
Validates our username. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MINIMUM_USERNAME_LENGTH
public static final int MAXIMUM_USERNAME_LENGTH
public static final String NAME_REGEX
protected String _username
| Constructor Detail |
|---|
public Username(String username)
throws InvalidUsernameException
InvalidUsernameException| Method Detail |
|---|
public String getUsername()
public String toString()
toString in class Object
protected void validateName(String username)
throws InvalidUsernameException
NAME_REGEX regular expression and be between MINIMUM_USERNAME_LENGTH and MAXIMUM_USERNAME_LENGTH characters.
InvalidUsernameException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||