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 * Create and return a new <code>User</code> object for the given name. 019 * 020 * <p>The default implementation creates and returns a direct instance of <code>User</code>.</p> 021 * 022 * @param sName the name of the user to be created. 023 * 024 * @return the new User object. Must not be <code>null</code>. 025 * 026 * @override Sometimes Override this method if you want the {@link UserManager} to 027 * {@link UserManager#createUser create} instances of subclasses of {@link User} rather than direct 028 * instances. 029 */ 030 public User createUser(String sName) { 031 return new User(sName); 032 } 033 }