Class DesignEngine
- java.lang.Object
-
- org.eclipse.birt.report.model.api.DesignEngine
-
- All Implemented Interfaces:
IDesignEngine
public final class DesignEngine extends java.lang.Object implements IDesignEngine
Represents the BIRT design engine as a whole. Used to create new designs or open existing designs.The design engine uses meta-data defined in an external file. This file is defined by BIRT and should both be available and valid. However, if an application wants to catch and handle errors associated with this file, it can create and register an instance of
IMetaLoggerbefore creating or opening the first report design. The logger is most useful for test suites.This is a wrapper class for the IDesignEngine. The new user should use the IDesignEngineFactory to create the IDesignEngine instead of use this class directly.
- See Also:
IMetaLogger,MetaLogManager
-
-
Field Summary
Fields Modifier and Type Field Description protected static IDesignEngineFactorycachedFactoryprotected IDesignEngineengineThe implementation of the design engine.protected static java.util.logging.LoggererrorLoggerThe logger for errors.
-
Constructor Summary
Constructors Constructor Description DesignEngine(DesignConfig config)Constructs a DesignEngine with the given platform config.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IMetaDataDictionarygetMetaData()Gets the meta-data of the design engine.static IMetaDataDictionarygetMetaDataDictionary()Deprecated.static SessionHandlenewSession(com.ibm.icu.util.ULocale locale)Deprecated.SessionHandlenewSessionHandle(com.ibm.icu.util.ULocale locale)Creates a new design session handle.IReportDesignopenDesign(java.lang.String fileName, java.io.InputStream ins, IModuleOption options)Opens the report design.voidregisterMetaLogger(IMetaLogger newLogger)Registers aIMetaLoggerto record initialization errors.booleanremoveMetaLogger(IMetaLogger logger)Removes aIMetaLogger.
-
-
-
Field Detail
-
errorLogger
protected static final java.util.logging.Logger errorLogger
The logger for errors.
-
cachedFactory
protected static IDesignEngineFactory cachedFactory
-
engine
protected IDesignEngine engine
The implementation of the design engine.
-
-
Constructor Detail
-
DesignEngine
public DesignEngine(DesignConfig config)
Constructs a DesignEngine with the given platform config.- Parameters:
config- the platform config.
-
-
Method Detail
-
newSessionHandle
public SessionHandle newSessionHandle(com.ibm.icu.util.ULocale locale)
Creates a new design session handle. The application uses the handle to open, create and manage designs. The session also represents the user and maintains the user's locale information.- Specified by:
newSessionHandlein interfaceIDesignEngine- Parameters:
locale- the user's locale. Ifnull, uses the system locale.- Returns:
- the design session handle
- See Also:
SessionHandle
-
newSession
@Deprecated public static SessionHandle newSession(com.ibm.icu.util.ULocale locale)
Deprecated.Creates a new design session handle. The application uses the handle to open, create and manage designs. The session also represents the user and maintains the user's locale information.This method is not suggested to use. The user should use new DesignEngine(config).newSessionHandle() to create the session.
- Parameters:
locale- the user's locale. Ifnull, uses the system locale.- Returns:
- the design session handle
- See Also:
SessionHandle
-
getMetaData
public IMetaDataDictionary getMetaData()
Gets the meta-data of the design engine.- Specified by:
getMetaDatain interfaceIDesignEngine- Returns:
- the meta-data of the design engine.
-
getMetaDataDictionary
@Deprecated public static IMetaDataDictionary getMetaDataDictionary()
Deprecated.Gets the meta-data dictionary of the design engine.This method is not suggested to use. The user should use new DesignEngine(config).getMetaData() to get the metadata dictionary.
- Returns:
- the meta-data dictionary of the design engine
-
registerMetaLogger
public void registerMetaLogger(IMetaLogger newLogger)
Registers aIMetaLoggerto record initialization errors. The logger will be notified of the errors during meta-data initialization. The meta-data system will be initialized once (and only once). Loggers should be registered before the first time a session is created so that it can be notified of the logging actions.- Specified by:
registerMetaLoggerin interfaceIDesignEngine- Parameters:
newLogger- theMetaLoggerto be registered.- See Also:
removeMetaLogger(IMetaLogger)
-
removeMetaLogger
public boolean removeMetaLogger(IMetaLogger logger)
Removes aIMetaLogger. This method will remove the logger from the list and close the logger if it has already been registered. The logger will no longer be notified of the errors during metadata initialization. Returnstrueif this logger manager contained the specified logger.- Specified by:
removeMetaLoggerin interfaceIDesignEngine- Parameters:
logger- theMetaLoggerto be removed.- Returns:
trueif this logger manager contained the specified logger.- See Also:
registerMetaLogger(IMetaLogger)
-
openDesign
public IReportDesign openDesign(java.lang.String fileName, java.io.InputStream ins, IModuleOption options) throws DesignFileException
Opens the report design.- Specified by:
openDesignin interfaceIDesignEngine- Parameters:
fileName- the report file nameins- the input stream. Can benull.options- options to control the way to open the design- Returns:
- the report design instance
- Throws:
DesignFileException- if the report file cannot be found or the file is invalid.
-
-