Package io.deephaven.importers
Class ImportFieldWriter
java.lang.Object
io.deephaven.importers.ImportFieldWriter
- Direct Known Subclasses:
BaseImportFieldWriter,JdbcFieldWriter
This class encapsulates common transformations that can be used in ImportSource elements. This class includes methods
for code generation, and all internal protected methods are intended for use with dynamic code generation/
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleaccountingDouble(String value) static intaccountingInt(String value) static longaccountingLong(String value) static StringcreateFormula(String formulaName, ImporterColumnDefinition col, Class setterType) static StringcreateTransform(ImporterColumnDefinition col, Class setterType) static StringcreateTransformDeclaration(ImporterColumnDefinition col, Class setterType) protected BigDecimal[]getBigDecimalArray(String value, boolean strict) protected BigDecimal[]getBigDecimalArray(String value, boolean strict, String arrayDelimiter) protected BigDecimal[]getBigDecimalArray(String value, String arrayDelimiter) protected BigInteger[]getBigIntegerArray(String value, boolean strict) protected BigInteger[]getBigIntegerArray(String value, boolean strict, String arrayDelimiter) protected BigInteger[]getBigIntegerArray(String value, String arrayDelimiter) protected Boolean[]getBooleanArray(String value, boolean strict) protected Boolean[]getBooleanArray(String value, boolean strict, String arrayDelimiter) protected Boolean[]getBooleanArray(String value, String arrayDelimiter) protected byte[]getByteArray(String value, boolean strict) protected byte[]getByteArray(String value, boolean strict, String arrayDelimiter) protected byte[]getByteArray(String value, String arrayDelimiter) protected char[]getCharArray(String value, boolean strict) protected char[]getCharArray(String value, boolean strict, String arrayDelimiter) protected char[]getCharArray(String value, String arrayDelimiter) @Nullable StringgetConstantColumnValue(@NotNull String columnName) Returns the value for the requested constant value column or nullprotected double[]getDoubleArray(String value, boolean strict) protected double[]getDoubleArray(String value, boolean strict, String arrayDelimiter) double[]getDoubleArray(String value, String arrayDelimiter) static IntFunction<String>getEnumFormatter(ImporterColumnDefinition col, boolean strict) protected float[]getFloatArray(String value, boolean strict) protected float[]getFloatArray(String value, boolean strict, String arrayDelimiter) protected float[]getFloatArray(String value, String arrayDelimiter) static Stringprotected Instant[]getInstantArray(String value, boolean strict) protected int[]getIntArray(String value, boolean strict) protected int[]getIntArray(String value, boolean strict, String arrayDelimiter) protected int[]getIntArray(String value, String arrayDelimiter) protected LocalDate[]getLocalDateArray(String value, boolean strict) protected LocalDate[]getLocalDateArray(String value, boolean strict, String arrayDelimiter) protected LocalDate[]getLocalDateArray(String value, String arrayDelimiter) protected LocalTime[]getLocalTimeArray(String value, boolean strict) protected LocalTime[]getLocalTimeArray(String value, boolean strict, String arrayDelimiter) protected LocalTime[]getLocalTimeArray(String value, String arrayDelimiter) protected long[]getLongArray(String value, boolean strict) protected long[]getLongArray(String value, boolean strict, String arrayDelimiter) long[]getLongArray(String value, String arrayDelimiter) static Stringprotected short[]getShortArray(String value, boolean strict) protected short[]getShortArray(String value, boolean strict, String arrayDelimiter) protected short[]getShortArray(String value, String arrayDelimiter) protected String[]getStringArray(String value, boolean strict) protected String[]getStringArray(String value, boolean strict, String arrayDelimiter) static LongFunction<Instant>instantFromLong(ImporterColumnDefinition col, boolean strict) static InstantinstantFromTimestamp(Timestamp sourceDateTime) static InstantinstantFromTimestamp(Timestamp sourceDateTime, String sourceColumnName, boolean strict) static LocalDatestatic BooleanparseBoolean(String value) voidvoidsetImportProperties(Map<String, String> importProperties) The setter to update the importProperties field in the FieldWriter.static StringstripFirstCharacter(String value) static longtoISONanos(String value) updateWithConstantColumnValue(io.deephaven.shadow.enterprise.org.jdom2.Element sourceElement, String constantValue, @NotNull Map<String, String> importProperties) Utility method that verifies if the givenElementincludes an Import Column attribute for a constant column.
-
Field Details
-
log
-
constantColumnValue
-
-
Constructor Details
-
ImportFieldWriter
-
-
Method Details
-
processField
- Throws:
IOException
-
getDbColumnName
-
getSetter
-
parseBoolean
-
getLongArray
-
getLongArray
-
getLongArray
-
getDoubleArray
-
getDoubleArray
-
getDoubleArray
-
getBooleanArray
-
getBooleanArray
-
getBooleanArray
@DynamicUse protected Boolean[] getBooleanArray(String value, boolean strict, String arrayDelimiter) -
getByteArray
-
getByteArray
-
getByteArray
-
getCharArray
-
getCharArray
-
getCharArray
-
getFloatArray
-
getFloatArray
-
getFloatArray
-
getIntArray
-
getIntArray
-
getIntArray
-
getShortArray
-
getShortArray
-
getShortArray
-
getBigDecimalArray
-
getBigDecimalArray
-
getBigDecimalArray
@DynamicUse protected BigDecimal[] getBigDecimalArray(String value, boolean strict, String arrayDelimiter) -
getBigIntegerArray
-
getBigIntegerArray
-
getBigIntegerArray
@DynamicUse protected BigInteger[] getBigIntegerArray(String value, boolean strict, String arrayDelimiter) -
getLocalTimeArray
-
getLocalTimeArray
-
getLocalTimeArray
@DynamicUse protected LocalTime[] getLocalTimeArray(String value, boolean strict, String arrayDelimiter) -
getLocalDateArray
-
getLocalDateArray
-
getLocalDateArray
@DynamicUse protected LocalDate[] getLocalDateArray(String value, boolean strict, String arrayDelimiter) -
getStringArray
-
getStringArray
-
instantFromTimestamp
-
instantFromTimestamp
@DynamicUse public static Instant instantFromTimestamp(Timestamp sourceDateTime, String sourceColumnName, boolean strict) -
instantFromLong
@DynamicUse public static LongFunction<Instant> instantFromLong(ImporterColumnDefinition col, boolean strict) -
localDateFromString
-
getEnumFormatter
@DynamicUse public static IntFunction<String> getEnumFormatter(ImporterColumnDefinition col, boolean strict) -
accountingInt
-
accountingLong
-
stripFirstCharacter
-
accountingDouble
-
getInstantArray
-
toISONanos
-
getImports
-
createFormula
public static String createFormula(String formulaName, ImporterColumnDefinition col, Class setterType) -
createTransformDeclaration
-
createTransform
-
updateWithConstantColumnValue
public static Map<String,String> updateWithConstantColumnValue(io.deephaven.shadow.enterprise.org.jdom2.Element sourceElement, String constantValue, @NotNull @NotNull Map<String, String> importProperties) Utility method that verifies if the givenElementincludes an Import Column attribute for a constant column. If found identifies the appropriate value associated for the column and returns a new unmodifiable Map that includes the (const column) to (constant column value) mapping.- Parameters:
sourceElement- The source in which to look for constant column attributesconstantValue- The global constant value for the csv importimportProperties- The custom import properties map- Returns:
- Returns an unmodifiable map that may include a constant column to constant column value mapping
-
setImportProperties
The setter to update the importProperties field in the FieldWriter. This is used while instantiating a customCsvFieldWriter, for a column using a custom setter Having access to the importProperties allows a Custom setter to access custom import properties along with access to constant column value using the methodgetConstantColumnValue(String)- Parameters:
importProperties- The custom properties map passed in csv import method
-
getConstantColumnValue
Returns the value for the requested constant value column or null- Parameters:
columnName- The constant value column name- Returns:
- the value of the constant column if found in importer properties or null
-