Class DataRow

  • All Implemented Interfaces:
    Serializable

    public class DataRow
    extends Object
    implements Serializable
    A DataRow is a container object with key/value pairs. Each key being a String and each value being a com.basiscomponents.db.DataField object.
    See Also:
    Serialized Form
    • Constructor Detail

      • DataRow

        public DataRow()
        Instantiates a new DataRow object.
      • DataRow

        public DataRow​(ResultSet resultSet)
        Instantiates a new DataRow object and sets the column metadata to the given ResultSet object's column metadata.
        Parameters:
        resultSet - The ResultSet whose column metadata will be used for this new DataRow
      • DataRow

        public DataRow​(Map<String,​Object> map)
                throws ParseException
        Creates a new DataRow object by parsing the specified HashMap object and DataFields for each of the HashMap's entries.
        Parameters:
        map - HashMap containing key/value pairs used to initialize the DataRow object
        Throws:
        ParseException
    • Method Detail

      • newInstance

        public static DataRow newInstance()
        Returns a new instance of a DataRow object.
        Returns:
        dataRow A newly instantiated DataRow object.
      • newInstance

        public static DataRow newInstance​(ResultSet resultSet)
        Returns a new instance of a DataRow object which has been initialized with the column metadata from the given ResultSet object.
        Parameters:
        resultSet - The ResultSet object whose metadata will be used for the new DataRow.
        Returns:
        dataRow The newly instantiated DataRow object.
      • fromJson

        public static DataRow fromJson​(String in,
                                       DataRow meta)
                                throws IOException,
                                       ParseException
        Returns a DataRow from a plain JSON String, honoring the types of an additional meta DataRow
        Parameters:
        in - A JSON string to be parsed into a new DataRow object
        meta - A DataRow serving as meta object to define the desirec types
        Returns:
        DataRow
        Throws:
        IOException
        ParseException
      • getRowID

        public int getRowID()
        Returns the row ID of this DataRow object.
        Returns:
        RowID The row ID of this DataRow object
      • setRowID

        public void setRowID​(int rowId)
        Sets the row ID of this DataRow object to the given value.
        Parameters:
        rowId - The new row ID value of this DataRow object
      • getFieldNames

        public BBArrayList<String> getFieldNames()
        Returns a BBArrayList object with all field names defined in this DataRow object.
        Returns:
        list The BBArrayList containing all field names defined in this DataRow object
      • contains

        public Boolean contains​(String name)
        Returns true if this DataRow contains a field matching the given field name, false otherwise.
        Parameters:
        name - The name of the field.
        Returns:
        contains True if the DataRow contains a field matching the given field name, false otherwise.
      • setAttribute

        public void setAttribute​(String name,
                                 String value)
        Sets the attribute with the specified name and value for this DataRow object.
        Parameters:
        name - The attribute's name
        value - The attribute's value
      • getAttribute

        public String getAttribute​(String name)
        Returns the attribute with the specified name or null if no attribute with this name exists.
        Parameters:
        name - The attribute's name
        Returns:
        attribute The attribute or null if no attribute with the given name exists
      • getAttributes

        public HashMap<String,​String> getAttributes()
        Returns a clone of this DataRow's attributes.
        Returns:
        attributesMap The java.util.HashMap with this DataRow's attributes
      • removeAttribute

        public void removeAttribute​(String name)
        Removes the attribute with the specified name from the DataRow's attributes if it exists. Does nothing if no attribute with the specified name exists.
        Parameters:
        name - The attributes name
      • setFieldValue

        public void setFieldValue​(String name,
                                  Object value)
                           throws ParseException
        Sets the specified value for the field with the specified name. In case no field with the specified name exists, then the field will be created.
        Parameters:
        name - The name of the field
        value - The value of the field
        Throws:
        ParseException - if a DataField cannot been parsed
      • setFieldValueC

        public void setFieldValueC​(String name,
                                   Object value,
                                   ConversionRuleSet crs)
                            throws ParseException
        Sets the specified value for the field with the specified name. In case no field with the specified name exists, then the field will be created.
        Parameters:
        name - The name of the field
        value - The value of the field
        crs - An optional rule set for field type conversions
        Throws:
        ParseException - if a DataField cannot been parsed
      • setFieldValue

        public void setFieldValue​(String name,
                                  int type,
                                  Object value)
                           throws ParseException
        Sets the specified value for the field with the specified name. In case no field with the specified name exists, then the field will be created with the specified SQL type.
        Parameters:
        name - The name of the field
        type - The SQL type of the field
        value - The value of the field
        Throws:
        ParseException
      • getEtag

        public String getEtag()
      • getField

        public DataField getField​(String name)
        Returns the DataField object for the specified field name.

        Throws an Exception if no field with the specified name exists.
        Parameters:
        name - The field's name
        Returns:
        dataField The DataField object
        Throws:
        Exception - No field with the specified name exists
      • getField

        public DataField getField​(String name,
                                  ConversionRuleSet crs)
        Returns the DataField object for the specified field name.

        Throws an Exception if no field with the specified name exists.
        Parameters:
        name - The field's name
        crs - A rule set for converting the field type / content
        Returns:
        dataField The DataField object
        Throws:
        Exception - No field with the specified name exists
      • getField

        public DataField getField​(String name,
                                  Boolean silent)
        Returns the DataField object for the specified field name. In case no field with the specified field name exists, depending on the specified boolean value, either an Exception is thrown or not. In fact, this boolean value indicates whether the Exception should be suppressed or not.
        Parameters:
        name - The field name
        silent - Boolean value indicating whether the eventual exception should be suppressed or not
        Returns:
        dataField The DataField
        Throws:
        Exception - No field with the specified name exists and the specified boolean value is false
      • getField

        public DataField getField​(String name,
                                  Boolean silent,
                                  ConversionRuleSet crs)
        Returns the DataField object for the specified field name. In case no field with the specified field name exists, depending on the specified boolean value, either an Exception is thrown or not. In fact, this boolean value indicates whether the Exception should be suppressed or not.
        Parameters:
        name - The field name
        silent - Boolean value indicating whether the eventual exception should be suppressed or not
        crs - A rule set for converting the field type / content
        Returns:
        dataField The DataField
        Throws:
        Exception - No field with the specified name exists and the specified boolean value is false
      • getFieldValue

        public Object getFieldValue​(String name)
        Returns the value of the field with the specified name as a java.lang.Object.
        Parameters:
        name - The name of the field
        Returns:
        value The field's value as an Object
        Throws:
        Exception - No field with the specified name exists.
      • getFieldAsString

        public String getFieldAsString​(String name)
        Returns the string value of the field matching the given field name or an empty string in case the field's value has not been set or is null.

        Throws an Exception if the given field name does not exist.
        Parameters:
        name - The name of the field.
        Returns:
        fieldValue The String representation of the field's value.
        Throws:
        Exception - No field with the specified name exists.
      • isEmpty

        public boolean isEmpty()
        Returns true if the DataRow has no fields, otherwise false.
        Returns:
        isEmpty True if the DataRow has no fields, false otherwise.
      • isFieldNull

        public Boolean isFieldNull​(String name)
        Returns true if the value of the field with the given name is null, false otherwise.

        Throws an Exception in case the field with the given name doesn't exist.
        Parameters:
        name - The name of the field
        Returns:
        isNull True in case the value of the field is null, false otherwise.
        Throws:
        Exception - No field with the specified name exists.
      • getFieldForSQL

        public String getFieldForSQL​(String name)
                              throws Exception
        Returns the value of the field with the given name as a String for usage in SQL statements. The field's value will be returned in single quotes if it has a value, otherwise NULL will be returned.

        Parameters:
        name - The name of the field
        Returns:
        fieldValue The field's value as a String for usage in SQL statements
        Throws:
        Exception - No field with the specified name exists.
      • getFieldAsNumber

        public Double getFieldAsNumber​(String fieldName)
        Returns the value of the field with given name as a Double.
        Parameters:
        fieldName - The name of the field whose value should be returned as Double
        Returns:
        value The field's value as a Double
        Throws:
        Exception - No field exists with the given name
      • getFieldAsBBjNumber

        public com.basis.util.common.BasisNumber getFieldAsBBjNumber​(String fieldName)
        Returns the value of the field with given name as a Double.
        Parameters:
        fieldName - The name of the field whose value should be returned as Double
        Returns:
        value The field's value as a BBjNumber (for use as a numeric variable in BBj)
        Throws:
        Exception - No field exists with the given name
      • getColumnIndex

        public int getColumnIndex​(String name)
        Returns the index of the column with the specified name.

        Throws an Exception if the specified column name doesn't exist.
        Parameters:
        name - The name of the column
        Returns:
        index The column's index
        Throws:
        Exception - The specified column name doesn't exist
      • getColumnIndex

        public int getColumnIndex​(String name,
                                  Boolean silent)
        Returns the index of the column with the specified name.

        In case the specified column name doesn't exist, depending on the specified boolean value, either an Exception is thrown or not. In fact, this boolean value indicates whether the Exception should be suppressed or not.
        Parameters:
        name - The name of the column
        silent - Boolean value indicating whether an eventual Exception should be suppressed or not
        Returns:
        index The column's index
        Throws:
        Exception - The specified column name doesn't exist and the silent boolean value is false
      • getColumnName

        public String getColumnName​(int column)
                             throws Exception
        Returns the column name for the specified column index.

        Throws an Exception in case the specified column index doesn't exist.
        Parameters:
        column - The column index
        Returns:
        name The column's name
        Throws:
        Exception - The specified column index doesn't exist
      • getColumnName

        public String getColumnName​(int column,
                                    Boolean silent)
                             throws Exception
        Returns the column name for the specified column index.

        In case the specified column index doesn't exist, depending on the specified boolean value, either an Exception is thrown, or not. In fact, this boolean value indicates whether the Exception should be suppressed or not.
        Parameters:
        column - The column index
        silent - Boolean value indicating whether an eventual Exception should be suppressed or not
        Returns:
        name The column's name
        Throws:
        Exception - The specified column index doesn't exist and the silent boolean value is false
      • getFieldType

        public int getFieldType​(String name)
        Returns the value of the ColumnType property from the metadata for the field with the given name.
        Parameters:
        name - The name of the field.
        Returns:
        The value of the ColumnType property for the field name.
        Throws:
        RuntimeException - The specified column name doesn't exist
      • getFieldType

        public int getFieldType​(String name,
                                ConversionRuleSet crs)
        Returns the value of the ColumnType property from the metadata for the field with the given name.
        Parameters:
        name - The name of the field.
        crs - A rule set for converting the field type / content
        Returns:
        The value of the ColumnType property for the field name.
        Throws:
        RuntimeException - The specified column name doesn't exist
      • getFieldTypeName

        public String getFieldTypeName​(String name)
                                throws Exception
        Returns the value of the ColumnTypeName property from the metadata for the field with the given name or an empty string in case the property isn't set.
        Parameters:
        name - The name of the field.
        Returns:
        The value of the ColumnTypeName property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • getFieldDisplaySize

        public int getFieldDisplaySize​(String fieldName)
                                throws Exception
        Returns the value of the DisplaySize property from the metadata for the field with the given name.
        Parameters:
        fieldName - The name of the field.
        Returns:
        The value of the DisplaySize property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • getFieldCatalogName

        public String getFieldCatalogName​(String fieldName)
                                   throws Exception
        Returns the value of the CatalogName property from the metadata for the field with the given name or an empty string in case the property isn't set.
        Parameters:
        fieldName - The name of the field.
        Returns:
        The value of the CatalogName property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • getFieldClassName

        public String getFieldClassName​(String fieldName)
                                 throws Exception
        Returns the value of the ClassName property from the metadata for the field with the given name or an empty string in case the property isn't set.
        Parameters:
        fieldName - The name of the field.
        Returns:
        The value of the ClassName property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns defined for this DataRow object.
        Returns:
        columnCount The number of columns defined for this DataRow object.
        Throws:
        Exception
      • getFieldLabel

        public String getFieldLabel​(String name)
                             throws Exception
        Returns the value of the Label property from the metadata for the field with the given name or an empty string in case the property isn't set.
        Parameters:
        name - The name of the field.
        Returns:
        The value of the Label property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • getFieldPrecision

        public int getFieldPrecision​(String name)
                              throws Exception
        Returns the value of the Precision property from the metadata for the field with the given name.
        Parameters:
        name - The name of the field.
        Returns:
        The value of the Precision property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • getFieldSchemaName

        public String getFieldSchemaName​(String name)
                                  throws Exception
        Returns the value of the SchemaName property from the metadata for the field with the given name or an empty string in case the property isn't set.
        Parameters:
        name - The name of the field.
        Returns:
        The value of the SchemaName property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • getFieldTableName

        public String getFieldTableName​(String name)
                                 throws Exception
        Returns the value of the TableName property from the metadata for the field with the given name or an empty string in case the property isn't set.
        Parameters:
        name - The name of the field.
        Returns:
        The value of the TableName property for the field name.
        Throws:
        Exception - The specified column name doesn't exist
      • setFieldAttribute

        public void setFieldAttribute​(String name,
                                      String attrname,
                                      String value)
        Sets the given attribute name and value for the field with the given name. Overwrites the attribute's value with the specified one in case the attribute already exists.
        Parameters:
        name - The field's name.
        attrname - The name of the attribute to set.
        value - The value of the attribute to set.
        Throws:
        Exception - No field exists with the given name.
      • getFieldAttribute

        public String getFieldAttribute​(String name,
                                        String attrname)
                                 throws Exception
        Returns the value of the attribute with the given name for the field with the given name.
        Parameters:
        name - The field name.
        attrname - The name of the attribute.
        Returns:
        The attribute's name.
        Throws:
        Exception - The field name doesn't exist.
      • getFieldAttributes

        public HashMap<String,​String> getFieldAttributes​(String name)
        Returns a HashMap with the attributes as strings of the field with the given name. The HashMap keys will be the attribute names and the HashMap values will be the attribute values. Might get Deprecated
        Parameters:
        name - The name of the field.
        Returns:
        A Map with the field's attributes as key/value pairs.
        Throws:
        Exception - No field exists with the given name
      • getFieldAttributes2

        public Map<String,​Attribute> getFieldAttributes2​(String name)
        Returns a HashMap with the attributes of the field with the given name. The HashMap keys will be the attribute names and the HashMap values will be the attribute values.
        Parameters:
        name - The name of the field.
        Returns:
        A Map with the field's attributes as key/value pairs.
        Throws:
        Exception - No field exists with the given name
      • removeFieldAttribute

        public void removeFieldAttribute​(String name,
                                         String attrname)
                                  throws Exception
        Removes the attribute with the given name from the field's attributes.
        Parameters:
        name - The name of the field.
        attrname - The name of the attribute.
        Throws:
        Exception - No field exists with the given name.
      • removeField

        public void removeField​(String fieldName)
        Removes the field with the given name from the list of fields.
        Parameters:
        fieldName - The name of the field to remove.
      • getAttributeForFields

        public ArrayList<String> getAttributeForFields​(String attrname)
        Returns a list containing all the attribute values for the given attribute name for each field defined in this DataRow.

        Note: The method also includes null values in case the attribute is not defined for a field.
        Parameters:
        attrname - The name of the attribute
        Returns:
        A list with the attribute values for the given attribute name.
        See Also:
        getAttributeForFields(String, Boolean)
      • getAttributeForFields

        public ArrayList<String> getAttributeForFields​(String attrname,
                                                       Boolean defaultToFieldname)
        Returns a list containing all the attribute values for the given attribute name, for each field defined in this DataRow.

        If the defaultToFieldname value is true, the method doesn't add null nor empty Strings to the list, instead the field's name will be added.
        Parameters:
        attrname - The name of the attribute.
        defaultToFieldname - The boolean value indicating whether to add null or empty Strings to the list or not.
        Returns:
        The list with the attribute values of each field defined in this DataRow for the given attribute name.
      • keySet

        public Set<String> keySet()
        Method to retrieve all keys in the dataFields
        Returns:
        the set of keys in the dataFields
      • replaceFields

        public String replaceFields​(String formula)
                             throws Exception
        Method replaceFields: Search and replace all the field names in a given string (formula) with the field value. The field name should be escaped as "F{name}".
        Parameters:
        formula - the string with the escaped field names
        Returns:
        String formula: the replaced string
        Throws:
        Exception
      • equals

        public Boolean equals​(DataRow dataRow)
        Compares the given DataRow object to the current one, and returns true in case they are equal, false otherwise.
        Parameters:
        dataRow - The DataRow object to compare with
        Returns:
        equal The boolean value indicating whether the DataRows are equal or not
      • addDataField

        public void addDataField​(String fieldName,
                                 DataField dataField)
        Adds a field with the given name and the given value(DataField) to the list of fields. The methods analyzes the DataField's value in order to determine its SQL Type.

        Note: In case a field with the same name does already exist, it will be overwritten.
        Parameters:
        fieldName - The name of the field to add
        dataField - The field's value
        Throws:
        Exception
        See Also:
        addDataField(String fieldName, int sqlType, DataField dataField)
      • addDataField

        public void addDataField​(String fieldName,
                                 int sqlType,
                                 DataField dataField)
        Adds a field with the given name, the given SQL Type and the given value(DataField) to the list of fields.

        Note: In case a field with the same name does already exist, it will be overwritten.
        Parameters:
        fieldName - The name of the field to add
        sqlType - The SQL Type of the field
        dataField - The field's value
        Throws:
        Exception
      • getDataField

        public DataField getDataField​(String fieldName)
        Deprecated.
        Returns the DataField object for the given field name. Returns null in case no field exists with the given name.
        Parameters:
        fieldName - The name of the field7
        Returns:
        dataField The DataField value for the given field name.
        See Also:
        getField(java.lang.String)
      • getInsertStatement

        public String getInsertStatement()
        Returns a SQL Insert statement based on the DataRow fields. The method does only return the part to add after the VALUES in the statement.
        Returns:
        insertStatement The insert statement created based on the DataRow fields.
      • getUpdateStatement

        public String getUpdateStatement()
        Returns a SQL Update statement based on the DataRow fields. The method does only return the part to add after the SET in the statement.
        Returns:
        updateStatement The update statement created based on the DataRow fields.
      • getObjects

        public HashMap<String,​Object> getObjects()
        Returns a java.util.HashMap<String,Object> object with the DataRow's field's as key value pairs.
        Returns:
        fieldMap The DataRow's fields as java.util.HashMap<String,Object> object.
      • mergeRecord

        public void mergeRecord​(DataRow dataRow,
                                Boolean fOverwrite)
        Merges this DataRow object with the given one by adding all fields of the given DataRow object to the current one.

        Note: The DataRow's field values will be overwritten by the values of the passed DataRow in case the field's exist in both.
        Parameters:
        dataRow - The DataRow object to merge with
        fOverwrite - set to true to always overwrite fields that already exist, false to skip those
      • mergeRecord

        public void mergeRecord​(DataRow dataRow)
        Merges this DataRow object with the given one by adding all fields of the given DataRow object to the current one.

        Note: The DataRow's field values will be overwritten by the values of the passed DataRow in case the field's exist in both.
        Parameters:
        dataRow - The DataRow object to merge with
      • fromURL

        public static DataRow fromURL​(String in)
                               throws Exception
        Creates a DataRow from a String in URL format Sample: field1=value1&field2=value2 will result in a DataRow with the two fields field1 and field2 holding the according values
        Parameters:
        in - the URL formatted code
        Returns:
        a new DataRow from the String
        Throws:
        Exception
      • toURL

        public String toURL()
                     throws Exception
        Creates a URL-encoded String out of the DataRow
        Returns:
        the URL encoded String
        Throws:
        Exception
      • toJson

        public String toJson()
                      throws Exception
        Returns the DataRow and all of its fields as a JSON String.
        Returns:
        The DataRow as JSON String
        Throws:
        Exception
      • toJson

        public String toJson​(String rowIndex)
                      throws Exception
        Returns the DataRow and all of its fields as a JSON String.
        Returns:
        The DataRow as JSON String
        Throws:
        Exception
      • toJson

        public String toJson​(Boolean f_meta)
                      throws Exception
        Returns the DataRow and all of its fields as a JSON String.
        Returns:
        The DataRow as JSON String
        Throws:
        Exception
      • toJson

        public String toJson​(Boolean f_meta,
                             String rowIndex,
                             Boolean f_trimStrings)
                      throws Exception
        Returns the DataRow and all of its fields as a JSON String.
        Returns:
        The DataRow as JSON String
        Throws:
        Exception
      • toJsonObject

        public String toJsonObject​(Boolean f_meta,
                                   String rowIndex,
                                   Boolean f_trimStrings)
                            throws Exception
        Returns the DataRow and all of its fields as a JSON String.
        Returns:
        The DataRow as JSON String
        Throws:
        Exception
      • toJsonElement

        public Object toJsonElement()
        Returns the DataRow as JsonArray object.
        Returns:
        jsonArray The DataRow as JsonArray object.
      • toJRDataSource

        public net.sf.jasperreports.engine.JRDataSource toJRDataSource()
        Returns this DataRow as a JRDataSource
        Returns:
        JRDataSourceAdapter representing a ResultSet with this record
      • addBytesToRowKey

        public void addBytesToRowKey​(byte[] keydata)
        Parameters:
        keydata - the key segment data as byte array to append to the row key
      • addToRowKey

        public void addToRowKey​(String keydata)
        Parameters:
        keydata - the key segment data as string of bytes to append to the row key
      • getRowKey

        public String getRowKey()
        Returns:
        the row key as string of bytes
      • setRowKey

        public void setRowKey​(String rowKey)
        Parameters:
        rowKey - the key value as string of bytes to set
      • resolveConstants

        public DataRow resolveConstants​(ConstantsResolver cr)
        Resolve any [[CONSTANT]] type of string inside all String fields note: if the CONSTANT contains "!CLEAR" the field will be removed from the DataRow (like an STBL gets cleared)
        Parameters:
        cr - an instance of the ConstantsResolver class that holds the constants
      • resolveConstants

        public DataRow resolveConstants​(ConstantsResolver cr,
                                        boolean removeUnsetFields)
        Resolve any [[CONSTANT]] type of string inside all String fields note: if the CONSTANT contains "!CLEAR" the field will be removed from the DataRow (like an STBL gets cleared)
        Parameters:
        cr - an instance of the ConstantsResolver class that holds the constants
        removeUnsetFields - if true all fields which could not be resolved will be removed
      • matches

        public boolean matches​(DataRow toCompare)
      • clear

        public void clear()
        Iterates over each DataField object, and calls the clear() method which sets the DataRow's value to null
      • getFieldsHavingAttribute

        public DataRow getFieldsHavingAttribute​(String attributeName)
        Returns a DataRow object with all fields defined in this DataRow which have the given attribute name. The fields where the attribute is defined but the attribute value is empty or null, will be ignored by this method.
        Parameters:
        attributeName - The name of the attribute.
        Returns:
        The DataRow with the fields where the attribute with the given name is defined.
        See Also:
        getFieldsHavingAttribute(String, boolean), getFieldsHavingAttribute(String, boolean, DataRow)
      • getFieldsHavingAttribute

        public DataRow getFieldsHavingAttribute​(String attributeName,
                                                boolean includeEmptyValues)
        Returns a DataRow object with all fields defined in this DataRow which have the given attribute name. The given boolean value defines whether to include the fields where the attribute is defined but the attribute value is empty (null or Empty String). If the value is set to true, these fields are included. If it is set to false, those fields will be ignored by the method.
        Parameters:
        attributeName - The name of the attribute.
        includeEmptyValues - The boolean value indicating whether to include fields with empty attribute values
        Returns:
        The DataRow with the fields where the attribute with the given name is defined.
        See Also:
        getFieldsHavingAttribute(String), getFieldsHavingAttribute(String, boolean, DataRow)
      • getFieldsHavingAttribute

        public DataRow getFieldsHavingAttribute​(String attributeName,
                                                boolean includeEmptyValues,
                                                DataRow dr)
        Returns all fields of this DataRow object being defined in the given DataRow object and also having the given attribute name set. The given boolean value defines whether to include the fields where the attribute is defined but the attribute value is empty (null or Empty String). If the value is set to true, these fields are included. If it is set to false, those fields will be ignored by the method.
        Parameters:
        attributeName - The name of the attribute.
        includeEmptyValues - The boolean value indicating whether to include fields with empty attribute values
        dr - The DataRow object's whose fields will be iterated over.
        Returns:
        The DataRow with the fields where the attribute with the given name is defined.
        See Also:
        getFieldsHavingAttribute(String), getFieldsHavingAttribute(String, boolean)
      • getFieldsHavingAttributeValue

        public DataRow getFieldsHavingAttributeValue​(String attributeName,
                                                     String attributeValue)
        Returns all fields of this DataRow, having the specified attribute name and attribute value.
        Parameters:
        attributeName - The name of the attribute.
        attributeValue - The value of the attribute.
        Returns:
        The DataRow with the fields where the attribute with the given name and value is defined.
      • getFieldsHavingAttributeValue

        public DataRow getFieldsHavingAttributeValue​(String attributeName,
                                                     String attributeValue,
                                                     DataRow dr)
        Returns all fields of this DataRow, having the specified attribute name and attribute value.
        Parameters:
        attributeName - The name of the attribute.
        attributeValue - The value of the attribute.
        dr - The DataRow object's whose fields will be iterated over.
        Returns:
        The DataRow with the fields where the attribute with the given name and value is defined.
      • getTemplate

        public String getTemplate()
        Returns a BBj String Template based on the values defined in this DataRow
        Returns:
        a BBj String Template with the values defined in this DataRow.
        See Also:
        getString()
      • getString

        public String getString()
                         throws Exception
        Returns the record String to initialize a BBj Templated String based on the values of this DataRow object.
        Returns:
        the record to initialize the BBj Templated String.
        Throws:
        Exception
        See Also:
        getTemplate()
      • fromTemplate

        public static DataRow fromTemplate​(String template)
        Converts and returns the given String Template as DataRow object containing the default field values.
        Parameters:
        template - The String Template
        Returns:
        a DataRow object created based on the given String Template
        See Also:
        fromTemplate(String, String)
      • fromTemplate

        public static DataRow fromTemplate​(String template,
                                           String record)
        Converts and returns the given String Template as DataRow object containing the values of the given record String.
        Parameters:
        template - The String Template
        record - The record to set
        Returns:
        a DataRow object created based on the given String Template
        See Also:
        fromTemplate(String)
      • setString

        public void setString​(String template,
                              String record)
                       throws Exception
        Adds the values from a BBj templated string to the current DataRow object. If the current DataRow object has already field definitions, then they will be used to cast/convert the value to the required field type. Otherwise the type from the templated string will be used.
        Parameters:
        template - The String Template
        record - The record to set
        Throws:
        Exception - Thrown when one of the templated string values doesn't match the field type of the DataRow.
      • setTemplate

        public void setTemplate​(String template)
      • copyAttributes

        public void copyAttributes​(DataRow datarow)
        Copies the attributes from the passed DataRow of all fields this Object also contains
        Parameters:
        datarow - the DataRow from which to copy the attributes