001 package users;
002
003 import java.io.Serializable;
004
005 /**
006 * A factory that can create User objects.
007 *
008 * @see User
009 * @see UserManager#createUser
010 *
011 * @author Steffen Zschaler
012 * @version 2.0 05/05/1999
013 * @since v2.0
014 */
015 public class UserCreator extends Object implements Serializable {
016
017 /**
018 * ID for serialization.
019 */
020 private static final long serialVersionUID = 7647230541318086663L;
021
022 /**
023 * Create and return a new <code>User</code> object for the given name.
024 *
025 * <p>The default implementation creates and returns a direct instance of <code>User</code>.</p>
026 *
027 * @param sName the name of the user to be created.
028 *
029 * @return the new User object. Must not be <code>null</code>.
030 *
031 * @override Sometimes Override this method if you want the {@link UserManager} to
032 * {@link UserManager#createUser create} instances of subclasses of {@link User} rather than direct
033 * instances.
034 */
035 public User createUser(String sName) {
036 return new User(sName);
037 }
038 }