public interface MetadataCollection
| Modifier and Type | Method and Description |
|---|---|
void |
addField(MetadataField<?> metadata)
Add the given
MetadataField field to the metadata list |
MetadataCollection |
fromJSON(String json)
Parse the given JSON string to extract the metadata.
|
List<MetadataField<?>> |
getFields() |
Map<String,MetadataField<?>> |
getInputFields() |
Map<String,MetadataField<?>> |
getOutputFields() |
boolean |
isUpdated() |
void |
removeField(MetadataField<?> metadata) |
com.entwinemedia.fn.data.json.JValue |
toJSON()
Format the metadata as JSON array
|
void |
updateStringField(MetadataField<?> current,
String value) |
com.entwinemedia.fn.data.json.JValue toJSON()
MetadataCollection fromJSON(String json) throws MetadataParsingException
[
{
"id" : "field id",
"value" : "field value",
// The following properties should not be present as they are useless,
// but they do not hurt for the parsing.
"label" : "EVENTS.SERIES.DETAILS.METADATA.LABEL",
"type" : "",
// The collection can be a json object like below...
"collection": { "id1": "value1", "id2": "value2" },
// Or a the id of the collection available through the resource endpoint
"collection": "USERS",
"readOnly": false
},
// Additionally fields
...
]
json - A JSON array of metadata as StringMetadataParsingException - if the JSON structure is not correctIllegalArgumentException - if the JSON string is null or emptyMap<String,MetadataField<?>> getInputFields()
Map<String,MetadataField<?>> getOutputFields()
void addField(MetadataField<?> metadata)
MetadataField field to the metadata listmetadata - The MetadataField field to addIllegalArgumentException - if the MetadataField is nullvoid removeField(MetadataField<?> metadata)
List<MetadataField<?>> getFields()
void updateStringField(MetadataField<?> current, String value)
boolean isUpdated()
Copyright © 2009–2019 Opencast Project. All rights reserved.