1
|
package eu.dnetlib.enabling.datastructures;
|
2
|
|
3
|
import java.io.IOException;
|
4
|
|
5
|
import javax.xml.bind.annotation.XmlRootElement;
|
6
|
|
7
|
import org.dom4j.Document;
|
8
|
import org.dom4j.DocumentException;
|
9
|
import org.springframework.core.io.Resource;
|
10
|
|
11
|
import eu.dnetlib.enabling.annotations.DnetResource;
|
12
|
import eu.dnetlib.rmi.objects.is.DnetResourceFormat;
|
13
|
import eu.dnetlib.rmi.objects.is.DnetResourceKind;
|
14
|
|
15
|
@XmlRootElement
|
16
|
@DnetResource(type = "MetadataFormat", kind = DnetResourceKind.CONFIGURATION, format = DnetResourceFormat.XML)
|
17
|
public class MetadataFormat extends AbstractXmlResource {
|
18
|
|
19
|
public MetadataFormat(final Resource res) throws IOException, DocumentException {
|
20
|
super(res);
|
21
|
}
|
22
|
|
23
|
@Override
|
24
|
protected String getName(final Document doc) {
|
25
|
return doc.valueOf("/format/@name");
|
26
|
}
|
27
|
|
28
|
@Override
|
29
|
protected String getCode(final Document doc) {
|
30
|
return doc.valueOf("/format/@name");
|
31
|
}
|
32
|
|
33
|
}
|