Class CSVService
- java.lang.Object
-
- uk.ac.bristol.hiddenmuseum.service.CSVService
-
public class CSVService extends java.lang.ObjectService to gather CSV File data.
-
-
Constructor Summary
Constructors Constructor Description CSVService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetCSV(java.lang.String query)generates the CSV file from the fields and the records supplied.static java.lang.StringgetCSVItem(java.lang.String query)gathers a specific record that matches a specific record ID.static java.util.List<java.lang.String>getFields()gathers all the field names from the database.static SearchRecordgetRecord(java.lang.String query)gathers a specific record that matches a specific record ID.static java.util.List<SearchRecord>getRecords(java.lang.String query)gathers all the records that match a specific query.
-
-
-
Method Detail
-
getFields
public static java.util.List<java.lang.String> getFields()
gathers all the field names from the database.- Returns:
- a list of all the field names.
-
getRecords
public static java.util.List<SearchRecord> getRecords(java.lang.String query)
gathers all the records that match a specific query.- Parameters:
query- the string you want to search the database for.- Returns:
- a list of all the appropriate records.
-
getRecord
public static SearchRecord getRecord(java.lang.String query)
gathers a specific record that matches a specific record ID.- Parameters:
query- the record ID of the item you want to look up.- Returns:
- the record that matches the record ID.
-
getCSV
public static java.lang.String getCSV(java.lang.String query)
generates the CSV file from the fields and the records supplied.- Parameters:
query- the string you want to search the database for.- Returns:
- a CSV file containing all records that match the query provided.
-
getCSVItem
public static java.lang.String getCSVItem(java.lang.String query)
gathers a specific record that matches a specific record ID.- Parameters:
query- the record ID of the item you want to look up.- Returns:
- the CSV file corresponding to the recordID given as a query.
-
-