Class ConfigVariable

  • All Implemented Interfaces:
    java.lang.Cloneable, IStructure, org.eclipse.birt.report.model.core.IPropertySet, org.eclipse.birt.report.model.core.IReferencable

    public class ConfigVariable
    extends org.eclipse.birt.report.model.core.ReferencableStructure
    This class represents a configuration variable in the report's config variable list. Reports frequently have deployment-specific dependencies. For example, developers often use a test database during development, but target a production database once the report is deployed. Or, an OEM may use a different company name in report titles for each of their customers.A configuration variable is simply a name/value pair very similar to an environment variable on Unix. Indeed, configuration variables include environment variables, along with other BIRT-specific values.

    This is a managed object, meaning that all changes should be made though the command layer so that they can be undone and redone. Each config variable has the following properties:

    Name
    a config variable has a unique and required name, so the report design can use the variable name to identify a config variable.
    Value
    value of the config variable.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CONFIG_VAR_STRUCT
      Name of this structure.
      static java.lang.String NAME_MEMBER
      Name of the config variable name member.
      static java.lang.String VALUE_MEMBER
      Name of the config variable value member.
      • Fields inherited from class org.eclipse.birt.report.model.core.ReferencableStructure

        clients, clientStructures, LIB_REFERENCE_MEMBER, libReference
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigVariable()
      Constructs the config var with a required name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object getIntrinsicProperty​(java.lang.String memberName)
      Returns the value of a structure property represented as a member variable.
      java.lang.String getName()
      Returns the config variable name.
      java.lang.String getReferencableProperty()
      Gets the value of the referencable member.
      java.lang.String getStructName()
      Returns the name of the structure definition.
      java.lang.String getValue()
      Returns the config variable value.
      StructureHandle handle​(SimpleValueHandle valueHandle, int index)
      Creates the specific handle of this structure.
      boolean isReferencableProperty​(java.lang.String memberName)
      Checks whether the member of the input name is the referencable member or not.
      protected void setIntrinsicProperty​(java.lang.String memberName, java.lang.Object value)
      Sets the value of of a structure property represented as a member variable.
      void setName​(java.lang.String name)
      Sets the config variable name.
      void setValue​(java.lang.String value)
      Sets the config vatiable value.
      java.lang.String toString()  
      java.util.List validate​(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
      Validate whether this structure is valid.
      • Methods inherited from class org.eclipse.birt.report.model.core.ReferencableStructure

        addClient, addClientStructure, broadcast, clone, dropClient, dropClientStructure, getClientList, getClientStructures, getLocalProperty, getProperty, hasReferences, isReferencable, updateReference
      • Methods inherited from class org.eclipse.birt.report.model.core.Structure

        checkStringMember, copy, equals, getCompatibleValue, getContext, getDefn, getElement, getExpressionProperty, getHandle, getHandle, getLocalProperty, getMemberDefn, getObjectDefn, getProperty, getStringProperty, isDesignTime, setContext, setExpressionProperty, setProperty, setProperty, setupContext, updateReference
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • CONFIG_VAR_STRUCT

        public static final java.lang.String CONFIG_VAR_STRUCT
        Name of this structure. Matches the definition in the meta-data dictionary.
        See Also:
        Constant Field Values
      • NAME_MEMBER

        public static final java.lang.String NAME_MEMBER
        Name of the config variable name member.
        See Also:
        Constant Field Values
      • VALUE_MEMBER

        public static final java.lang.String VALUE_MEMBER
        Name of the config variable value member.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConfigVariable

        public ConfigVariable()
        Constructs the config var with a required name.
    • Method Detail

      • getStructName

        public java.lang.String getStructName()
        Description copied from interface: IStructure
        Returns the name of the structure definition. The name is the one used to define the structure in the meta-data dictionary.
        Returns:
        the internal name of the structure a defined in the meta-data dictionary.
      • getIntrinsicProperty

        protected java.lang.Object getIntrinsicProperty​(java.lang.String memberName)
        Description copied from class: org.eclipse.birt.report.model.core.Structure
        Returns the value of a structure property represented as a member variable.
        Overrides:
        getIntrinsicProperty in class org.eclipse.birt.report.model.core.ReferencableStructure
        Parameters:
        memberName - name of the property
        Returns:
        the value of the property, or null if the property is not set
      • setIntrinsicProperty

        protected void setIntrinsicProperty​(java.lang.String memberName,
                                            java.lang.Object value)
        Description copied from class: org.eclipse.birt.report.model.core.Structure
        Sets the value of of a structure property represented as a member variable.
        Overrides:
        setIntrinsicProperty in class org.eclipse.birt.report.model.core.ReferencableStructure
        Parameters:
        memberName - the name of the property to set
        value - the property value
      • getName

        public java.lang.String getName()
        Returns the config variable name.
        Returns:
        the config variable name.
      • setName

        public void setName​(java.lang.String name)
        Sets the config variable name.
        Parameters:
        name - the name to set
      • getValue

        public java.lang.String getValue()
        Returns the config variable value.
        Returns:
        the config variable value.
      • setValue

        public void setValue​(java.lang.String value)
        Sets the config vatiable value.
        Parameters:
        value - the config value to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • handle

        public StructureHandle handle​(SimpleValueHandle valueHandle,
                                      int index)
        Description copied from class: org.eclipse.birt.report.model.core.Structure
        Creates the specific handle of this structure. This handle is always created.
        Specified by:
        handle in class org.eclipse.birt.report.model.core.Structure
        Parameters:
        valueHandle - the value handle of this structure list property this structure is in
        index - the position of this structure in structure list
        Returns:
        the handle of this structure.
      • validate

        public java.util.List validate​(org.eclipse.birt.report.model.core.Module module,
                                       org.eclipse.birt.report.model.core.DesignElement element)
        Description copied from class: org.eclipse.birt.report.model.core.Structure
        Validate whether this structure is valid. The derived class should override this method if semantic check is needed. The each error is the instance of PropertyValueException.
        Overrides:
        validate in class org.eclipse.birt.report.model.core.ReferencableStructure
        Parameters:
        module - the module
        element - the element contains this structure
        Returns:
        the semantic error list
      • isReferencableProperty

        public boolean isReferencableProperty​(java.lang.String memberName)
        Description copied from class: org.eclipse.birt.report.model.core.ReferencableStructure
        Checks whether the member of the input name is the referencable member or not.
        Specified by:
        isReferencableProperty in class org.eclipse.birt.report.model.core.ReferencableStructure
        Parameters:
        memberName - the member name to check
        Returns:
        true if the member with the given name is referencable, otherwise false
      • getReferencableProperty

        public java.lang.String getReferencableProperty()
        Description copied from class: org.eclipse.birt.report.model.core.Structure
        Gets the value of the referencable member.
        Overrides:
        getReferencableProperty in class org.eclipse.birt.report.model.core.Structure
        Returns:
        the value of the referencable member