Package org.dspace.app.bulkedit
Class DSpaceCSVLine
java.lang.Object
org.dspace.app.bulkedit.DSpaceCSVLine
- All Implemented Interfaces:
Serializable
Utility class to store a line from a CSV file
- Author:
- Stuart Lewis
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new CSV line for a new itemDSpaceCSVLine(UUID itemId) Create a new CSV line -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new metadata value to this lineGet all the values that match the given metadata key.Get any action associated with this linegetID()Get the item ID that this line representskeys()Get all the metadata keys that are represented in this lineprotected StringWrite this line out as a CSV formatted string, in the order given by the headings providedprotected StringvalueToCSV(List<String> values, String valueSeparator) Internal method to create a CSV formatted String joining a given set of elements
-
Field Details
-
authorityValueService
-
-
Constructor Details
-
DSpaceCSVLine
Create a new CSV line- Parameters:
itemId- The item ID of the line
-
DSpaceCSVLine
public DSpaceCSVLine()Create a new CSV line for a new item
-
-
Method Details
-
getID
Get the item ID that this line represents- Returns:
- The item ID
-
add
Add a new metadata value to this line- Parameters:
key- The metadata key (e.g. dc.contributor.author)value- The metadata value
-
get
Get all the values that match the given metadata key. Will be null if none exist.- Parameters:
key- The metadata key- Returns:
- All the elements that match
-
getAction
Get any action associated with this line- Returns:
- The action (may be blank, 'withdraw', 'reinstate' or 'delete')
-
keys
Get all the metadata keys that are represented in this line- Returns:
- An enumeration of all the keys
-
toCSV
Write this line out as a CSV formatted string, in the order given by the headings provided- Parameters:
headings- The headings which define the order the elements must be presented infieldSeparator- separator between metadata fieldsvalueSeparator- separator between metadata values (within a field)- Returns:
- The CSV formatted String
-
valueToCSV
Internal method to create a CSV formatted String joining a given set of elements- Parameters:
values- The values to create the string fromvalueSeparator- value separator- Returns:
- The line as a CSV formatted String
-