org.objectweb.easybeans.persistence.xml
Class JPersistenceUnitInfoHelper

java.lang.Object
  extended by org.objectweb.easybeans.persistence.xml.JPersistenceUnitInfoHelper

public final class JPersistenceUnitInfoHelper
extends java.lang.Object

Class used to fill PersistenceInfo implementation class.

Author:
Florent Benoit

Field Summary
private static java.lang.String DEFAULT_PERSISTENCE_CONFIG
          Default XML configuration.
private static JPersistenceUnitInfo defaultPersistenceunitInfo
          Default configuration of persistence.xml (it defines the default persistence provider and links to external config, one for each provider class name.
private static JLog logger
          Logger.
private static java.util.Map<java.lang.String,JPersistenceUnitInfo> providersInfo
          Defines the default configuration (properties) for each persistence provider.
 
Constructor Summary
private JPersistenceUnitInfoHelper()
          Utility class, no public constructor.
 
Method Summary
static JPersistenceUnitInfo[] getPersistenceUnitInfo(java.net.URL url)
          Parses the given XML and complete the PersistenceUnitInfos structure before returning it.
private static void loadDefaultValues()
          Loads the default values (global configuration) and then configuration of each persistence provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PERSISTENCE_CONFIG

private static final java.lang.String DEFAULT_PERSISTENCE_CONFIG
Default XML configuration.

See Also:
Constant Field Values

logger

private static JLog logger
Logger.


defaultPersistenceunitInfo

private static JPersistenceUnitInfo defaultPersistenceunitInfo
Default configuration of persistence.xml (it defines the default persistence provider and links to external config, one for each provider class name.


providersInfo

private static java.util.Map<java.lang.String,JPersistenceUnitInfo> providersInfo
Defines the default configuration (properties) for each persistence provider.

Constructor Detail

JPersistenceUnitInfoHelper

private JPersistenceUnitInfoHelper()
Utility class, no public constructor.

Method Detail

getPersistenceUnitInfo

public static JPersistenceUnitInfo[] getPersistenceUnitInfo(java.net.URL url)
                                                     throws JPersistenceUnitInfoException
Parses the given XML and complete the PersistenceUnitInfos structure before returning it.

Parameters:
url - the URL of the the Reader of the XML file.
Returns:
array of jPersistenceInfo which are implementation of PersistenceUnitInfo object
Throws:
JPersistenceUnitInfoException - if values are incorrect.

loadDefaultValues

private static void loadDefaultValues()
                               throws JPersistenceUnitInfoException
Loads the default values (global configuration) and then configuration of each persistence provider.

Throws:
JPersistenceUnitInfoException - if default configuration is not found