Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

About the rom.def file

The rom.def file contains metadata defining the specific ROM elements, their properties, their slots, and their methods. You can find rom.def in:


The rom.def file is an internal file that the design engine uses to present a property sheet for a ROM element. The property sheet for an element contains the element’s properties and their types, the element’s methods, and valid choice selections for each of the element’s properties.

The rom.def file specifies the following kinds of metadata:

  • Choice

    A choice definition specifies all the allowable values that an attribute can have. Most choice definitions relate to style attributes. The following example from rom.def defines all the allowable font families available to a fontFamily style specification.

    <ChoiceType name="fontFamily">
       <Choice displayNameID="Choices.fontFamily.serif"
          name="serif" />
       <Choice displayNameID="Choices.fontFamily.sans-serif"
          name="sans-serif" />
       <Choice displayNameID="Choices.fontFamily.cursive"
          name="cursive" />
       <Choice displayNameID="Choices.fontFamily.fantasy"
          name="fantasy" />
       <Choice displayNameID="Choices.fontFamily.monospace"
          name="monospace" />
  • Class

    A class definition defines a Java class that a report designer application can access using the BIRT model API. There are class descriptions for data types, such as String, Date, and Array. There are also class descriptions for the functional classes such as Total, Finance, and DateTimeSpan. Finally, there are class definitions for the report object definitions, such as Report, DataSet, DataSource, ReportDefn, and ColumnDefn. A class definition consists of definitions of the class attributes, methods, and localization identifiers. The following example from rom.def defines the Report class.

    <Class displayNameID="Class.Report" name="Report"
       <Member dataType="ReportDefn"
          displayNameID="Class.Report.design" name="design"
          toolTipID="Class.Report.design.toolTip" />
       <Member dataType="Object[]"
          displayNameID="Class.Report.params" name="params"
          toolTipID="Class.Report.params.toolTip" />
       <Member dataType="Object[]"
          displayNameID="Class.Report.config" name="config"
          toolTipID="Class.Report.config.toolTip" />

    The preceding class definition does not have methods. The following example illustrates a class method definition.

    <Method displayNameID="Class.Total.sum" isStatic="true"
       name="sum" returnType="number"
       <Argument name="expr" tagID="Class.Total.sum.expr"
          type="number" />
       <Argument name="filter" tagID="Class.Total.sum.filter"
          type="String" />
       <Argument name="group" tagID="Class.Total.sum.group"
          type="String" />
  • Element

    An element definition consists of the element’s name, display name, methods, and properties, as well as the element from which it inherits. The rom.def file contains an element definition for every ROM element. The following example from the rom.def file illustrates an element definition.

    <Element canExtend="true"
       isAbstract="false" isNameRequired="true"
          .OdaDataSource" name="OdaDataSource" since="1.0"
          isIntrinsic="true" name="extensionID" since="1.0"
          type="string" />
       <Property detailType="ExtendedProperty"
          isList="true" name="privateDriverProperties"
          type="structure" />
       <PropertyVisibility name="extensionID"
          visibility="hide" />
       <PropertyVisibility name="privateDriverProperties"
          visibility="hide" />

    The preceding element definition does not contain any methods. The following example illustrates an element method definition.

    <Method context="factory"
       name="open" since="1.0"
       <Argument name="reportContext"
             .IReportContext" />
       <Argument name="object"
          type="Object" />
  • Structure

    A structure is a complex data type that usually consists of two or more members. A few structures that are candidates for future expansion have only a single member. The following example from the rom.def file illustrates the definition of a structure.

    <Structure displayNameID="Structure.DateTimeFormatValue"
       name="DateTimeFormatValue" since="1.0">
       <Member detailType="dateTimeFormat"
          isIntrinsic="true" name="category" since="1.0"
          type="choice" />
           isIntrinsic="true" name="pattern" since="1.0"
           type="string" />
  • Style

    A style definition contains the least information of any type of metadata described in rom.def. A style definition defines the name of the style, its display name, and a reference value. The following example illustrates a style definition.

    <Style displayNameID="Style.Report" name="report"
       reference="Overall default" />
  • Validator

    A validator definition specifies a Java class with which to do validation. Two of the validator classes are for validating values and all the rest are semantic validators. The following example from rom.def shows how to specify a validator.

       modules="design, library"
       name="DataSetResultSetValidator" />
  • + Share This
  • 🔖 Save To Your Account