Magic Model Analyst helps you read fUML runtime values from an Excel file. The following API will read the values of a specific row from a spreadsheet in an Excel file, and then create an fUML ValueList to store the values.
public ValueList readObjectFromSpreadSheet(String fileName, String sheetName, Number rowIndex, Object mappingElement) { ... }
The APIs can ignore the sheetName and use the first sheet of the selected spreadsheet instead.
public ValueList readObjectFromSpreadSheet(String fileName, Number rowIndex, Object mappingElement) { ... }
The following API will read the values from multiple rows of the selected spreadsheet in the Excel file, and then create the fUML ValueList to store the values.
public ValueList readObjectsFromSpreadSheet(String fileName, String sheetName, Number startRow, Number endRow, Object mappingElement) { ... }
The APIs can ignore the sheetName and use the first sheet of the selected spreadsheet instead.
public ValueList readObjectsFromSpreadSheet(String fileName, Number startRow, Number endRow, Object mappingElement) { ... }
If you want to read all values from the selected spreadsheet, you can use the following API:
public ValueList readObjectsFromSpreadSheet(String fileName, String sheetName, Object mappingElement) { ... }
The API can ignore the sheetName and use the first sheet of the selected spreadsheet instead.
public ValueList readObjectsFromSpreadSheet(String fileName, Object mappingElement) { ... }
The mappingElement parameter can be a String or an element for representing a mapping Class name or a mapping Class element.
Information
«ImportMap» can be used as the mappingElement. However, it is strongly recommended that you define the distinctive name of «ImportMap» and the «DiagramTableMapToDataSource» (an Instance table linked to an Excel file) when using to avoid conflict of object mappingElement.
The APIs can ignore the mappingElement then create the runtime object of the file schema element that is matched with filename.
public ValueList readObjectFromSpreadSheet(String fileName, String sheetName, Number rowIndex) { ... } public ValueList readObjectFromSpreadSheet(String fileName, Number rowIndex) { ... } public ValueList readObjectsFromSpreadSheet(String fileName, String sheetName, Number startRow, Number endRow) { ... } public ValueList readObjectsFromSpreadSheet(String fileName, Number startRow, Number endRow) { ... }
The following API can assign a name parameter to check the name of a mappingElement or a sheetName. If the matching mappingElement cannot be found, this API will use the file schema element to create a runtime object and check the sheet name of the Excel file with the name parameter.
public ValueList readObjectsFromSpreadSheet(String fileName, String name) { ... }