Betty v1.1.0

christophedelory.betty.xml
Class IdDetails

java.lang.Object
  extended by christophedelory.betty.xml.Child
      extended by christophedelory.betty.xml.IdDetails
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ChampionshipDetails, CountryDetails, EventDetails, ModelDetails, PhaseDetails, PlayerIdDetails, PropertyDetails, ResourceDetails, UserDetails

public class IdDetails
extends Child

The base representation of an XML object owning an identifier.

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

Constructor Summary
IdDetails()
           
 
Method Summary
protected  void accept(XmlVisitor visitor)
          Accepts the specified XML visitor.
 void addDescription(DescriptionDetails description)
          Adds the specified description to this object.
 void addLink(LinkDetails link)
          Adds the specified link to this object.
 DescriptionDetails findDescriptionByLocale(String locale)
          Searches for a description in this XML element that matches the input parameter.
 LinkDetails findLinkByLocale(String locale)
          Searches for a link in this XML element that matches the input parameter.
 List<DescriptionDetails> getDescriptions()
          Returns the list of descriptions attached to this object.
 String getId()
          Returns the object identifier.
 List<LinkDetails> getLinks()
          Returns the list of links attached to this object.
 void setId(String id)
          Initializes the object identifier.
 
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

IdDetails

public IdDetails()
Method Detail

setId

public void setId(String id)
Initializes the object identifier.

Parameters:
id - an identifier. Shall not be null.
Throws:
NullPointerException - if id is null.
See Also:
getId()

getId

public String getId()
Returns the object identifier.

Returns:
an identifier. May be null if not yet initialized.
See Also:
setId(String)

getDescriptions

public List<DescriptionDetails> getDescriptions()
Returns the list of descriptions attached to this object.

Returns:
a list of descriptions. May be empty but not null.
See Also:
addDescription(DescriptionDetails)

addDescription

public void addDescription(DescriptionDetails description)
Adds the specified description to this object.

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

findDescriptionByLocale

public DescriptionDetails findDescriptionByLocale(String locale)
Searches for a description in this XML element that matches the input parameter.

Parameters:
locale - a locale. May be null.
Returns:
an XML representation of the description, or null if none was found.
Since:
1.0.0

getLinks

public List<LinkDetails> getLinks()
Returns the list of links attached to this object.

Returns:
a list of links. May be empty but not null.
See Also:
addLink(LinkDetails)

addLink

public void addLink(LinkDetails link)
Adds the specified link to this object.

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

findLinkByLocale

public LinkDetails findLinkByLocale(String locale)
Searches for a link in this XML element that matches the input parameter.

Parameters:
locale - a locale. May be null.
Returns:
an XML representation of the link, or null if none was found.
Since:
1.0.0

accept

protected void accept(XmlVisitor visitor)
               throws Exception
Accepts the specified XML visitor.

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.