base.user
Class User

java.lang.Object
  extended by java.util.Observable
      extended by base.user.User
All Implemented Interfaces:
IXMLLoadable, IXMLSaveable

public class User
extends java.util.Observable
implements IXMLSaveable, IXMLLoadable


Field Summary
 java.util.Date creationDate
           
 
Constructor Summary
protected User(int id)
           
protected User(int id, java.lang.String name, java.lang.String surname, java.lang.String gender, java.util.Date birthday, java.lang.String nickname, java.lang.String password, java.lang.String credential, Document document)
           
 
Method Summary
 void addEAddress(EAddress eAddress)
           
 void addNAddress(NAddress nAddress)
           
 void addPhoneNumber(PhoneNumber phoneNumber)
           
static java.lang.String buildUserPassword(java.lang.String password)
           
 void deleteEAddress(EAddress eAddress)
           
 void deleteNAddress(NAddress nAddress)
           
 void deletePhoneNumber(PhoneNumber phoneNumber)
           
 java.lang.Object fromXml(org.w3c.dom.Document document)
          This method offers the opportunity to load an interface's implementing Object from a particular XML document.
 java.util.Date getBirthday()
           
 java.util.Date getCreationDate()
           
 java.lang.String getCredential()
           
 Document getDocument()
           
 EAddress[] getEAddress()
           
 EAddress getEAddressById(int addressId)
           
 java.lang.String getGender()
           
 int getId()
           
 java.lang.String getImagePath()
           
 NAddress[] getNAddress()
           
 NAddress getNAddressById(int addressId)
           
 java.lang.String getName()
           
 java.lang.String getNickname()
           
 java.lang.String getPassword()
           
 PhoneNumber[] getPhoneNumber()
           
 PhoneNumber getPhoneNumberById(int phoneNumberId)
           
 java.lang.String getSurname()
           
 EAddress newEAddress(java.lang.String eAddress)
           
 NAddress newNAddress(java.lang.String city, java.lang.String nation, java.lang.String street, java.lang.String region, java.lang.String postalCode, java.lang.String description)
           
 PhoneNumber newPhoneNumber(java.lang.String areaCode, java.lang.String exchange, java.lang.String number, java.lang.String description)
           
 void setBirthday(java.util.Date birthday)
           
 void setCredential(java.lang.String credential)
           
 void setDocument(Document document)
           
 void setGender(java.lang.String gender)
           
protected  void setId(int id)
           
 void setImagePath(java.lang.String imagePath)
           
 void setName(java.lang.String name)
           
 void setNickname(java.lang.String nickname)
           
 void setPassword(java.lang.String password)
           
 void setSurname(java.lang.String surname)
           
 java.lang.String toString()
           
 org.w3c.dom.Node toXml(org.w3c.dom.Document document)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

creationDate

public java.util.Date creationDate
Constructor Detail

User

protected User(int id,
               java.lang.String name,
               java.lang.String surname,
               java.lang.String gender,
               java.util.Date birthday,
               java.lang.String nickname,
               java.lang.String password,
               java.lang.String credential,
               Document document)
Parameters:
id - The user's id.
name - The user's name.
surname - The user's surname.
gender - The user's gender.
birthday - The user's birthday.
nickname - The user's nickname.
password - The user's password.
credential - The user's id.
document - The user's document.

User

protected User(int id)
Method Detail

getImagePath

public java.lang.String getImagePath()
Returns:
Returns the imagePath.

setImagePath

public void setImagePath(java.lang.String imagePath)
Parameters:
imagePath - The imagePath to set.

getPassword

public java.lang.String getPassword()
Returns:
Returns the password.

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - The password to set.

setBirthday

public void setBirthday(java.util.Date birthday)
Parameters:
birthday - The birthday to set.

setCredential

public void setCredential(java.lang.String credential)
Parameters:
credential - The credential to set.

setDocument

public void setDocument(Document document)
Parameters:
document - The document to set.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

setNickname

public void setNickname(java.lang.String nickname)
Parameters:
nickname - The nickname to set.

setSurname

public void setSurname(java.lang.String surname)
Parameters:
surname - The surname to set.

getDocument

public Document getDocument()
Returns:
Returns the document.

getName

public java.lang.String getName()
Returns:
Returns the name.

getNickname

public java.lang.String getNickname()
Returns:
Returns the nickname.

getSurname

public java.lang.String getSurname()
Returns:
Returns the surname.

getCredential

public java.lang.String getCredential()
Returns:
Returns the credential.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getBirthday

public java.util.Date getBirthday()
Returns:
Returns the birthday.

getId

public int getId()
Returns:
Returns the id.

getGender

public java.lang.String getGender()
Returns:
Returns the gender.

setGender

public void setGender(java.lang.String gender)
Parameters:
gender - The gender to set.

getCreationDate

public java.util.Date getCreationDate()
Returns:
Returns the creationDate.

buildUserPassword

public static java.lang.String buildUserPassword(java.lang.String password)
Parameters:
password - The User's password.
Returns:
Returns an MD5 digest of the user's password.

getEAddress

public EAddress[] getEAddress()
Returns:
Returns the eAddress.

getNAddress

public NAddress[] getNAddress()
Returns:
Returns the nAddress.

getPhoneNumber

public PhoneNumber[] getPhoneNumber()
Returns:
Returns the phoneNumber.

addEAddress

public void addEAddress(EAddress eAddress)

addNAddress

public void addNAddress(NAddress nAddress)

addPhoneNumber

public void addPhoneNumber(PhoneNumber phoneNumber)

newNAddress

public NAddress newNAddress(java.lang.String city,
                            java.lang.String nation,
                            java.lang.String street,
                            java.lang.String region,
                            java.lang.String postalCode,
                            java.lang.String description)

newEAddress

public EAddress newEAddress(java.lang.String eAddress)

newPhoneNumber

public PhoneNumber newPhoneNumber(java.lang.String areaCode,
                                  java.lang.String exchange,
                                  java.lang.String number,
                                  java.lang.String description)

getNAddressById

public NAddress getNAddressById(int addressId)
Parameters:
addressId - The id associated to the NAddress
Returns:
The NAddress whose id is addressId, null if such nAddressId is not contained in the user's nAddress set.

getEAddressById

public EAddress getEAddressById(int addressId)
Parameters:
addressId - The id associated to an EAddress.
Returns:
The EAddress whose id is addressId, null if such eAddressId is not contained in the user's eAddress set.

getPhoneNumberById

public PhoneNumber getPhoneNumberById(int phoneNumberId)
Parameters:
phoneNumberId - The id associated to a PhoneNumber.
Returns:
The PhoneNumber whose id is phoneNumberId, null if such phoneNumberId is not contained in the user's phoneNumber set.

deleteNAddress

public void deleteNAddress(NAddress nAddress)
Parameters:
nAddress - Deletes the nAddress form the user's nAddress set.

deleteEAddress

public void deleteEAddress(EAddress eAddress)
Parameters:
eAddress - Deletes the eAddress from the user's eAddress set.

deletePhoneNumber

public void deletePhoneNumber(PhoneNumber phoneNumber)
Parameters:
phoneNumber - Deletes the phoneNumber from the user's phoneNumber set.

toXml

public org.w3c.dom.Node toXml(org.w3c.dom.Document document)
Specified by:
toXml in interface IXMLSaveable

fromXml

public java.lang.Object fromXml(org.w3c.dom.Document document)
Description copied from interface: IXMLLoadable
This method offers the opportunity to load an interface's implementing Object from a particular XML document.

Specified by:
fromXml in interface IXMLLoadable
Parameters:
document - The document from wich the implementing object must be loaded.

setId

protected void setId(int id)
Parameters:
id - The id to set.


Copyright © 2006 SF.net. All Rights Reserved.