Class ImporterColumnDefinition

All Implemented Interfaces:
com.fishlib.base.Copyable, com.fishlib.base.log.LogOutputAppendable, com.fishlib.base.SafeCloneable, com.fishlib.dataobjects.persistence.WObjectStreamConstants, com.fishlib.dataobjects.WAbstractDataObject, Externalizable, Serializable, Cloneable

public class ImporterColumnDefinition extends ColumnDefinition
Encapsulates details about ImportColumns from the schema, such as sourceType, formulae, etc
See Also:
  • Constructor Details

    • ImporterColumnDefinition

      public ImporterColumnDefinition()
    • ImporterColumnDefinition

      public ImporterColumnDefinition(ColumnDefinition c, org.jdom2.Element sourceElement)
      Creates a new ImporterColumnDefinition object
      Parameters:
      c - The Iris Table column that will receive data
      sourceElement - The ImportSource from the schema being used that will be searched for a matching ImportColumn
  • Method Details

    • getIndex

      public int getIndex()
      Gets the index set by setIndex(int) or createNameMap(Element, TableDefinition, List). If setIndex(int) has never been called, then the index will be the index of the definition within the schema ImportSource element.
      Returns:
      The index value.
    • setIndex

      public void setIndex(int index)
      Sets the internal index value for this row. This can be used by importers to track a particular column's index within the source.
      Parameters:
      index - The index
    • getFailDefault

      public boolean getFailDefault()
      Check whether we should try to return a default when import of a field fails
      Returns:
      boolean - true when we should try to return a default if this field fails assignment during import
    • getImportColumn

      public org.jdom2.Element getImportColumn()
    • getTransform

      public String getTransform()
    • getSetter

      public String getSetter()
    • getFormula

      public String getFormula()
    • getSpecifiedDefault

      public <T> T getSpecifiedDefault(Class<T> type)
    • getDefault

      public String getDefault()
      Returns:
      The default value for the column, if one exists, or null if there is no default for this column
    • getDefaultValue

      public String getDefaultValue()
      Returns:
      The default value for the column, if one exists, or null if there is no default for this column
    • setSourceName

      public void setSourceName(String newName)
    • getSourceName

      public String getSourceName()
    • getPropertyName

      public String getPropertyName()
    • getSourceNameOrDefault

      public String getSourceNameOrDefault()
    • getImportSource

      public org.jdom2.Element getImportSource()
    • getNullable

      public boolean getNullable()
    • getCacheable

      public boolean getCacheable()
    • getCacheSize

      public String getCacheSize()
    • getSourceType

      public Class<?> getSourceType()
      Returns:
      The Class of the source type, from the String sourceType from the schema XML
    • createNameMap

      public static Map<String,ImporterColumnDefinition> createNameMap(org.jdom2.Element sourceElement, TableDefinition tableDefinition, List<String> sourceColumns)
    • isConstantColumn

      public static boolean isConstantColumn(String sourceType)
      Utility method to identify if a column defined in ImportSource elements is a constant column.
      Parameters:
      sourceType - The sourceType as defined in the ImportColumn element of schema
      Returns:
      true if the column is defined as a constant column