com.ldodds.foaf.thinlet.model
Class ModelImpl

java.lang.Object
  |
  +--com.ldodds.foaf.thinlet.model.ModelImpl
All Implemented Interfaces:
Model, Validatable

public class ModelImpl
extends java.lang.Object
implements Model

Simple model implementation.

Author:
ldodds
See Also:
Model

Constructor Summary
ModelImpl()
           
 
Method Summary
 void addFriend(Person friend)
          Adds a friend of the current person.
 Person getCurrentPerson()
          Retrieves the current person, i.e the representation of the user entering data into the application.
 java.util.List getErrors()
          Asks the object for validation errors.
 java.util.List getFriends()
          Retrieves the friends of the current person.
 void setCurrentPerson(Person p)
          Sets the current person
 boolean validate()
          Asks the object to validate itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelImpl

public ModelImpl()
Method Detail

getCurrentPerson

public Person getCurrentPerson()
Description copied from interface: Model
Retrieves the current person, i.e the representation of the user entering data into the application.
Specified by:
getCurrentPerson in interface Model
See Also:
Model.getCurrentPerson()

getFriends

public java.util.List getFriends()
Description copied from interface: Model
Retrieves the friends of the current person.
Specified by:
getFriends in interface Model
See Also:
Model.getFriends()

addFriend

public void addFriend(Person friend)
Description copied from interface: Model
Adds a friend of the current person. If the current person is null then a new empty person should be created.
Specified by:
addFriend in interface Model
See Also:
Model.addFriend(Person)

setCurrentPerson

public void setCurrentPerson(Person p)
Description copied from interface: Model
Sets the current person
Specified by:
setCurrentPerson in interface Model
See Also:
com.ldodds.foaf.thinlet.model.Model#setCurrentPerson()

getErrors

public java.util.List getErrors()
Description copied from interface: Validatable
Asks the object for validation errors.
Specified by:
getErrors in interface Validatable
See Also:
Validatable.getErrors()

validate

public boolean validate()
Description copied from interface: Validatable
Asks the object to validate itself. No indication of validation errors are returned. These should be inspected with @see #getErrors.
Specified by:
validate in interface Validatable
See Also:
Validatable.validate()