Class CsvResourceMetadata
java.lang.Object
com.aquima.interactions.framework.connectivity.CsvResourceMetadata
- All Implemented Interfaces:
ICsvResourceMetadata
Class to create a ICsvResourceMetadata implementation base on a connection that is available in a project.
- Since:
- 8.3
- Author:
- Jon van Leuven
-
Method Summary
Modifier and TypeMethodDescriptionstatic CsvResourceMetadata
This method may be used to create an ICsvResourceMetadata implementation for a connection that is available in the project.This method returns the charset used for decoding the csv resource.This method returns the metadata for all the columns.int[]
This method returns the column widths for a fixed width text resource.char
This method returns the delimiter to use for separating entries.char
This method returns the character to use for quoted elements.boolean
This method returns true if the CSV resource's first row contains the headers.boolean
This method returns true the resource should be parsed as a fixed width text resource.
-
Method Details
-
createFor
public static CsvResourceMetadata createFor(String connectionName, IProject project) throws UnknownConnectionException, UnknownValueFormatException, PatternException This method may be used to create an ICsvResourceMetadata implementation for a connection that is available in the project.- Parameters:
connectionName
- The name of the connection that contains the available metadata.project
- The project that contains the connection definitions.- Returns:
- The ICsvResourceMetadata implementation, never null.
- Throws:
UnknownConnectionException
- Is throw when there is no connection definition available in the project for the specified name.UnknownValueFormatException
- Is throw when there there is a reference to an unknown value format.PatternException
- Is throw when there there is an invalid format pattern defined.
-
isFixedWidthText
public boolean isFixedWidthText()Description copied from interface:ICsvResourceMetadata
This method returns true the resource should be parsed as a fixed width text resource.- Specified by:
isFixedWidthText
in interfaceICsvResourceMetadata
- Returns:
- True if it is a fixed width resource, false if it is a standard CSV resource.
-
getColumnWidths
public int[] getColumnWidths()Description copied from interface:ICsvResourceMetadata
This method returns the column widths for a fixed width text resource.- Specified by:
getColumnWidths
in interfaceICsvResourceMetadata
- Returns:
- An array of column widths.
-
getDelimiter
public char getDelimiter()Description copied from interface:ICsvResourceMetadata
This method returns the delimiter to use for separating entries.- Specified by:
getDelimiter
in interfaceICsvResourceMetadata
- Returns:
- The delimiter to use for separating entries, may only be one character.
-
getQuoteCharacter
public char getQuoteCharacter()Description copied from interface:ICsvResourceMetadata
This method returns the character to use for quoted elements.- Specified by:
getQuoteCharacter
in interfaceICsvResourceMetadata
- Returns:
- The character for quoted elements.
-
hasRowHeaders
public boolean hasRowHeaders()Description copied from interface:ICsvResourceMetadata
This method returns true if the CSV resource's first row contains the headers.- Specified by:
hasRowHeaders
in interfaceICsvResourceMetadata
- Returns:
- True if the first row are the headers.
-
getColumnMetadata
Description copied from interface:ICsvResourceMetadata
This method returns the metadata for all the columns.- Specified by:
getColumnMetadata
in interfaceICsvResourceMetadata
- Returns:
- All the columns metadata objects, never null.
-
getCharset
Description copied from interface:ICsvResourceMetadata
This method returns the charset used for decoding the csv resource.- Specified by:
getCharset
in interfaceICsvResourceMetadata
- Returns:
- Charset defined, or null.
-