Betty v1.1.0

christophedelory.betty.xml
Class EventDetails

java.lang.Object
  extended by christophedelory.betty.xml.Child
      extended by christophedelory.betty.xml.IdDetails
          extended by christophedelory.betty.xml.EventDetails
All Implemented Interfaces:
HasScoreModel, Serializable

public class EventDetails
extends IdDetails
implements HasScoreModel

A championship's event XML representation.

Version:
$Revision$
Author:
Christophe Delory
See Also:
EventBean, Serialized Form

Constructor Summary
EventDetails()
           
 
Method Summary
 void accept(XmlVisitor visitor)
          Accepts the specified XML visitor.
 void addPlayerId(PlayerIdDetails playerId)
          Adds a player to this event.
 PlayerIdDetails findPlayerIdByDependencyPhase(String phaseRef, int phaseRank)
          Searches for a player reference in this XML description that matches the input parameters.
 PlayerIdDetails findPlayerIdById(String id)
          Searches for a player reference in this XML description that matches the input parameter.
 String getDateString()
          Returns the event's date as a string.
 LocationDetails getLocation()
          Returns the event's location.
 List<PlayerIdDetails> getPlayerIds()
          Returns a list of players optionally attached to this event.
 ScoreModelDetails getScoreModel()
          Returns the score processing model.
 UsersDetails getUsers()
          Returns a list of users optionally attached to this event.
 void setDateString(String date)
          Initializes the event's date as a string.
 void setLocation(LocationDetails location)
          Initializes the event's location.
 void setScoreModel(ScoreModelDetails model)
          Initializes the score processing model.
 void setUsers(UsersDetails users)
          Initializes the list of users optionally attached to this event.
 
Methods inherited from class christophedelory.betty.xml.IdDetails
addDescription, addLink, findDescriptionByLocale, findLinkByLocale, getDescriptions, getId, getLinks, setId
 
Methods inherited from class christophedelory.betty.xml.Child
getParent, getRoot, getRoot, getVersion, setParent, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventDetails

public EventDetails()
Method Detail

setDateString

public void setDateString(String date)
Initializes the event's date as a string.
Two formats are available:
  1. "yyyy-MM-dd'T'HH:mm'Z'": an ISO8601 date-time with explicit (Zulu) time zone;
  2. "yyyy-MM-dd'T'HH:mm": an ISO8601 date-time with no time zone specifier: the location's time zone will be used.

Parameters:
date - a date as a string. Shall not be null.
Throws:
NullPointerException - if date is null.
See Also:
getDateString()

getDateString

public String getDateString()
Returns the event's date as a string.

Returns:
a date as a string. May be null if not yet initialized.
See Also:
setDateString(String)

getScoreModel

public ScoreModelDetails getScoreModel()
Description copied from interface: HasScoreModel
Returns the score processing model.

Specified by:
getScoreModel in interface HasScoreModel
Returns:
a score processing model. Shall not be null.
Throws:
IllegalStateException - if no score processing model could be found in this instance or its hierarchy.
See Also:
HasScoreModel.setScoreModel(ScoreModelDetails)

setScoreModel

public void setScoreModel(ScoreModelDetails model)
Description copied from interface: HasScoreModel
Initializes the score processing model.

Specified by:
setScoreModel in interface HasScoreModel
Parameters:
model - a score processing model. May be null.
See Also:
HasScoreModel.getScoreModel()

setLocation

public void setLocation(LocationDetails location)
Initializes the event's location.

Parameters:
location - a location. Shall not be null.
Throws:
NullPointerException - if location is null.
See Also:
getLocation()

getLocation

public LocationDetails getLocation()
Returns the event's location.

Returns:
a location. May be null if not yet initialized.
See Also:
setLocation(LocationDetails)

addPlayerId

public void addPlayerId(PlayerIdDetails playerId)
Adds a player to this event.

Parameters:
playerId - a player. Shall not be null.
Throws:
NullPointerException - if playerId is null.
See Also:
getPlayerIds()

getPlayerIds

public List<PlayerIdDetails> getPlayerIds()
Returns a list of players optionally attached to this event.

Returns:
a list of players. May be empty but not null.
See Also:
addPlayerId(PlayerIdDetails)

findPlayerIdByDependencyPhase

public PlayerIdDetails findPlayerIdByDependencyPhase(String phaseRef,
                                                     int phaseRank)
Searches for a player reference in this XML description that matches the input parameters.

Parameters:
phaseRef - a phase reference identifier. Must not be null.
phaseRank - the rank in the dependency phase.
Returns:
an XML representation of the player reference, or null if none was found.
Throws:
NullPointerException - if phaseRef is null.

findPlayerIdById

public PlayerIdDetails findPlayerIdById(String id)
Searches for a player reference in this XML description that matches the input parameter.

Parameters:
id - a player identifier. Must not be null.
Returns:
an XML representation of the player reference, or null if none was found.
Throws:
NullPointerException - if id is null.

getUsers

public UsersDetails getUsers()
Returns a list of users optionally attached to this event.

Returns:
a list of users. May be null.
See Also:
setUsers(UsersDetails)

setUsers

public void setUsers(UsersDetails users)
Initializes the list of users optionally attached to this event.

Parameters:
users - a list of users. May be null.
See Also:
getUsers()

accept

public void accept(XmlVisitor visitor)
            throws Exception
Description copied from class: IdDetails
Accepts the specified XML visitor.

Overrides:
accept in class IdDetails
Parameters:
visitor - a visitor. Shall not be null.
Throws:
NullPointerException - if visitor is null.
Exception - if any error occurs during the visit.

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.