Betty v1.1.0

christophedelory.betty
Class EntityToXml

java.lang.Object
  extended by christophedelory.betty.EntityToXml

public class EntityToXml
extends Object

EJB to XML binding.

Since:
0.9.2
Version:
$Revision: 101 $
Author:
Christophe Delory

Field Summary
static SimpleDateFormat ISO8601_DATETIMEZ_FORMAT
          The ISO8601 date-time formatter with explicit (Zulu) time zone.
static EntityToXml SINGLETON
          A ready-to-use instance of this class.
 
Constructor Summary
EntityToXml()
           
 
Method Summary
protected  void fillCountryDetails(DbCountryEntity dbEntity, CountryDetails xml, Locale[] locales)
          Builds an XML representation of the specified EJB object.
 ChampionshipDetails toXml(LocalChampionship dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 EventDetails toXml(LocalEvent dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 LocationDetails toXml(LocalLocation dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 void toXml(LocalMetadata dbEntity, AbstractMetadataDetails xml, Locale[] locales)
          Builds an XML representation of the specified EJB object.
 void toXml(LocalModel dbEntity, ModelDetails xml, Locale[] locales)
          Builds an XML representation of the specified EJB object.
 PhaseDetails toXml(LocalPhase dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 PlayerDetails toXml(LocalPlayer dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 PlayerIdDetails toXml(LocalPlayerScore dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 PropertyDetails toXml(LocalProperty dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 ResourceDetails toXml(LocalResource dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 UserDetails toXml(LocalUser dbEntity, Locale[] locales)
          Returns an XML representation of the specified EJB object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON

public static final EntityToXml SINGLETON
A ready-to-use instance of this class.


ISO8601_DATETIMEZ_FORMAT

public static final SimpleDateFormat ISO8601_DATETIMEZ_FORMAT
The ISO8601 date-time formatter with explicit (Zulu) time zone.

Constructor Detail

EntityToXml

public EntityToXml()
Method Detail

toXml

public ChampionshipDetails toXml(LocalChampionship dbEntity,
                                 Locale[] locales)
                          throws Exception
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.

toXml

public PhaseDetails toXml(LocalPhase dbEntity,
                          Locale[] locales)
                   throws Exception
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.

toXml

public EventDetails toXml(LocalEvent dbEntity,
                          Locale[] locales)
                   throws Exception
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.

toXml

public void toXml(LocalModel dbEntity,
                  ModelDetails xml,
                  Locale[] locales)
           throws Exception
Builds an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
xml - the target XML object. Should not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
NullPointerException - if dbEntity is null.
NullPointerException - if xml is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.

toXml

public LocationDetails toXml(LocalLocation dbEntity,
                             Locale[] locales)
                      throws Exception
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.
See Also:
fillCountryDetails(DbCountryEntity,CountryDetails,Locale[])

toXml

public PlayerDetails toXml(LocalPlayer dbEntity,
                           Locale[] locales)
                    throws Exception
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.
See Also:
fillCountryDetails(DbCountryEntity,CountryDetails,Locale[])

fillCountryDetails

protected void fillCountryDetails(DbCountryEntity dbEntity,
                                  CountryDetails xml,
                                  Locale[] locales)
                           throws Exception
Builds an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
xml - the target XML object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
NullPointerException - if dbEntity is null.
NullPointerException - if xml is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.

toXml

public PlayerIdDetails toXml(LocalPlayerScore dbEntity,
                             Locale[] locales)
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.

toXml

public UserDetails toXml(LocalUser dbEntity,
                         Locale[] locales)
                  throws Exception
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.

toXml

public ResourceDetails toXml(LocalResource dbEntity,
                             Locale[] locales)
                      throws Exception
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.
Exception - if any exception or error occurs.

toXml

public PropertyDetails toXml(LocalProperty dbEntity,
                             Locale[] locales)
Returns an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Returns:
an XML object representing the EJB object.
Throws:
EJBException - if any exception occured during the execution of this method.
NullPointerException - if dbEntity is null.
NullPointerException - if locales is null.

toXml

public void toXml(LocalMetadata dbEntity,
                  AbstractMetadataDetails xml,
                  Locale[] locales)
Builds an XML representation of the specified EJB object.

Parameters:
dbEntity - the input EJB object. Shall not be null.
xml - the target XML object. Shall not be null.
locales - the preferred locales that the caller will accept content in. Should not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
NullPointerException - if dbEntity is null.
NullPointerException - if xml is null.
NullPointerException - if locales is null.

© 2008-2009 Christophe Delory

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