Class FieldConfig


  • public class FieldConfig
    extends ConfigBase
    This class holds the definition of fields for the database table to work with. The definition was read from the configuration XML file.
    Author:
    faessler
    • Constructor Detail

      • FieldConfig

        public FieldConfig​(byte[] configData,
                           String schemaName)
                    throws com.ximpleware.VTDException
        Throws:
        com.ximpleware.VTDException
    • Method Detail

      • isKnownType

        public static boolean isKnownType​(String type)
      • isBinaryDataType

        public static boolean isBinaryDataType​(String type)
      • isStringTypeArray

        public static boolean isStringTypeArray​(String type)
        Parameters:
        type -
        Returns:
      • isXmlType

        public static boolean isXmlType​(String type)
      • isBooleanType

        public static boolean isBooleanType​(String type)
        Parameters:
        type -
        Returns:
      • isTimestampWithoutTZType

        public static boolean isTimestampWithoutTZType​(String type)
        Returns true if the string type equals the SQL "timestamp without time zone" type.
        Parameters:
        type - String to test.
        Returns:
        True if type denotes a timestamp type without timezone information.
      • isStringType

        public static boolean isStringType​(String type)
      • isIntegerType

        public static boolean isIntegerType​(String type)
        Parameters:
        type -
        Returns:
      • getName

        public String getName()
        Returns:
        the name
      • isBinary

        public boolean isBinary()
      • isNsAware

        public boolean isNsAware()
      • getForEachXPath

        public String getForEachXPath()
      • setForEachXPath

        public void setForEachXPath​(String forEachXPath)
      • isOfTimestampWithoutTZType

        public boolean isOfTimestampWithoutTZType​(String fieldName)
      • isOfStringType

        public boolean isOfStringType​(String fieldName)
      • isOfStringType

        public boolean isOfStringType​(Map<String,​String> field)
      • isOfIntegerType

        public boolean isOfIntegerType​(Map<String,​String> field)
      • isOfBinaryDataType

        public boolean isOfBinaryDataType​(Map<String,​String> field)
      • getPrimaryKey

        public String[] getPrimaryKey()
        Returns:
        - An Array with the names off all primary keys
      • getPrimaryKeyFieldNumbers

        public List<Integer> getPrimaryKeyFieldNumbers()
        Returns:
        - The indices of those fields which are primary keys, beginning with 0
      • getColumnsToRetrieve

        public String[] getColumnsToRetrieve()
      • getPrimaryKeyString

        public String getPrimaryKeyString()
        Returns the names of the columns forming the primary key in a CSV format.

        This method calls getPrimaryKey() to obtain the list of primary key column names. It then builds a string consisting of these names separated by commas and returns this string.

        Example: If the primary key columns are "pmid" and "systemID", the string returned would be "pmid,systemID".

        Returns:
        A comma separated list of the column names which form the primary key in this table scheme.
      • expandPKNames

        public String[] expandPKNames​(String[] fmtStrs)
        Takes an array of format strings according to String.format(String, Object...) with a single %s symbol. The number of format string must be equal to the number of primary key elements of this table schema definition. Then, for the ith format string, the ith primary key element is applied.
        Parameters:
        fmtStrs - The format string to fill with primary key elements, one format string per primary key element.
        Returns:
        An array of strings corresponding to the format strings filled with the primary key elements.
      • expandPKNames

        public String[] expandPKNames​(String fmtStr)
        Applies each primary key element to the format string and returns the results as array. Each result element corresponds to one primary key element applied to the format string.
        Parameters:
        fmtStr - The format string to be filled with the primary key elements.
        Returns:
        All results corresponding to applying each primary key element once to the given format string.
      • getTimestampFieldName

        public String getTimestampFieldName()
      • getConfigText

        public String getConfigText()
      • getColumns

        public String[] getColumns()