Package de.xima.fc.gui.utils.data
Class StringDataSheetUtils
- java.lang.Object
 - 
- de.xima.fc.gui.utils.data.StringDataSheetUtils
 
 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SheetDimensionfindSheetDimensions(org.apache.poi.ss.usermodel.Sheet sheet)static StringgetCSVStringFromDataSheet(StringDataSheet sheet)static StringDataSheetgetDataSheet(String data, CSVFormatWrapper csvFormat, int startAtLine)static StringDataSheetgetDataSheetFromCSVByteArray(byte[] bytes, CSVFormatWrapper csvFormat, int startAtLine)static StringDataSheetgetDataSheetFromCSVString(String csvString, CSVFormatWrapper csvFormat, int startAtLine)static StringDataSheetgetDataSheetFromExcelByteArray(byte[] data, String sheetName, int startAtLine)Generates aStringDataSheetfor the given sheet namestatic StringDataSheetgetDataSheetFromTemplate(Textbaustein template, Locale clientLocale, String technicalNameKeyColumn, String displayNameKeyColumn, String technicalNameDefaultColumn)Create aStringDataSheetobject and returns it.static Map<String,StringDataSheet>getDataSheetsFromExcelByteArray(byte[] data)Generates aMapwithStringDataSheets (values) and their names (key)static Map<String,StringDataSheet>getDataSheetsFromExcelByteArray(byte[] data, List<String> sheetNames)Generates aMapwithStringDataSheets (values) and their names (key) for the given sheet namesstatic StringDataSheetgetDefaultDataSheet()static Map<String,Properties>getPropertyObjectsFromDataSheet(StringDataSheet dataSheet, String columnNameForPropertyKey, String columnNameForDefault, Locale currentClientLocale)Generates a Properties-Object from all Columns in given data sheet.static CharsetguessCharset(InputStream is)static voidprefillDataSheetReferencesFromSystemProperties(ADataSheet<String> sheet, String keyColumnName, String refContent)Fills the given data sheet with the data from the system properties. 
 - 
 
- 
- 
Method Detail
- 
getDefaultDataSheet
public static final StringDataSheet getDefaultDataSheet()
 
- 
getCSVStringFromDataSheet
public static final String getCSVStringFromDataSheet(StringDataSheet sheet)
 
- 
getDataSheetFromCSVString
public static final StringDataSheet getDataSheetFromCSVString(String csvString, CSVFormatWrapper csvFormat, int startAtLine) throws Exception
- Throws:
 Exception
 
- 
getDataSheet
public static final StringDataSheet getDataSheet(String data, CSVFormatWrapper csvFormat, int startAtLine) throws Exception
- Throws:
 Exception
 
- 
getDataSheetFromCSVByteArray
public static final StringDataSheet getDataSheetFromCSVByteArray(byte[] bytes, CSVFormatWrapper csvFormat, int startAtLine) throws Exception
- Throws:
 Exception
 
- 
guessCharset
public static Charset guessCharset(InputStream is) throws IOException
- Throws:
 IOException
 
- 
getDataSheetFromExcelByteArray
public static final StringDataSheet getDataSheetFromExcelByteArray(byte[] data, String sheetName, int startAtLine) throws Exception
Generates aStringDataSheetfor the given sheet name- Parameters:
 data- byte array of excel file (.xls or .xlsx)sheetName-Stringof sheet name to generateStringDataSheets for- Returns:
 StringDataSheetfor given sheet name- Throws:
 Exception- when an error during the reading occurs
 
- 
getDataSheetsFromExcelByteArray
public static final Map<String,StringDataSheet> getDataSheetsFromExcelByteArray(byte[] data, List<String> sheetNames) throws Exception
Generates aMapwithStringDataSheets (values) and their names (key) for the given sheet names- Parameters:
 data- byte array of excel file (.xls or .xlsx)sheetNames-Listof names to generateStringDataSheets for- Returns:
 Mapwith sheet names and sheets- Throws:
 Exception- when an error during the reading occurs
 
- 
getDataSheetsFromExcelByteArray
public static final Map<String,StringDataSheet> getDataSheetsFromExcelByteArray(byte[] data) throws Exception
Generates aMapwithStringDataSheets (values) and their names (key) 
- 
getDataSheetFromTemplate
public static final StringDataSheet getDataSheetFromTemplate(Textbaustein template, Locale clientLocale, String technicalNameKeyColumn, String displayNameKeyColumn, String technicalNameDefaultColumn) throws IOException
Create aStringDataSheetobject and returns it. The entries are read from the givenTextbaustein.- Parameters:
 template- theTextbausteinobject with the language specific overloaded propertiesclientLocale- the locale of the currentMandantobjecttechnicalNameKeyColumn- technical name for the key columndisplayNameKeyColumn- display name for the key columntechnicalNameDefaultColumn- technical name of the default column- Returns:
 - the read 
StringDataSheet - Throws:
 IOException- when an error during the reading occurs
 
- 
prefillDataSheetReferencesFromSystemProperties
public static final void prefillDataSheetReferencesFromSystemProperties(ADataSheet<String> sheet, String keyColumnName, String refContent)
Fills the given data sheet with the data from the system properties.- Parameters:
 sheet- the data sheet to prefillkeyColumnName- the name of the 'key' columnrefContent- The reference values.
 
- 
getPropertyObjectsFromDataSheet
public static final Map<String,Properties> getPropertyObjectsFromDataSheet(StringDataSheet dataSheet, String columnNameForPropertyKey, String columnNameForDefault, Locale currentClientLocale)
Generates a Properties-Object from all Columns in given data sheet. One column from the data sheet must be defined as properties key.- Parameters:
 dataSheet- contains the data for the properties objectscolumnNameForPropertyKey- name of the columns, which represents the key's for the properties-objectscolumnNameForDefault- name of the column, with represents the default locale for the clientcurrentClientLocale- the current locale ofMandant-object- Returns:
 - a 
Map-object with all overloaded Properties 
 
- 
findSheetDimensions
public static SheetDimension findSheetDimensions(org.apache.poi.ss.usermodel.Sheet sheet)
 
 - 
 
 -