Revision 49184
Added by Sandro La Bruzzo over 6 years ago
AbstractResolverParser.java | ||
---|---|---|
6 | 6 |
import java.util.Map; |
7 | 7 |
import javax.xml.stream.XMLStreamReader; |
8 | 8 |
|
9 |
import eu.dnetlib.dli.resolver.model.ObjectType; |
|
10 |
import eu.dnetlib.dli.resolver.model.ResolvedObject; |
|
9 |
|
|
10 |
import eu.dnetlib.dli.resolver.model.DLIResolvedObject; |
|
11 |
import eu.dnetlib.pid.resolver.model.ObjectType; |
|
11 | 12 |
import org.apache.commons.lang3.StringUtils; |
12 | 13 |
import org.apache.commons.logging.Log; |
13 | 14 |
import org.apache.commons.logging.LogFactory; |
... | ... | |
20 | 21 |
protected static final Log log = LogFactory.getLog(AbstractResolverParser.class); |
21 | 22 |
private List<String> datasetSubTypes = Arrays.asList("dataset", "software", "film", "sound", "physicalobject", "audiovisual", "collection", "other", "study", "metadata"); |
22 | 23 |
|
23 |
public abstract ResolvedObject parseObject(final String record);
|
|
24 |
public abstract DLIResolvedObject parseObject(final String record);
|
|
24 | 25 |
|
25 | 26 |
protected Map<String, String> getAttributes(final XMLStreamReader parser) { |
26 | 27 |
final Map<String, String> attributesMap = new HashMap<>(); |
... | ... | |
30 | 31 |
return attributesMap; |
31 | 32 |
} |
32 | 33 |
|
33 |
protected void setType(final ResolvedObject object, final String type) {
|
|
34 |
if (!StringUtils.isBlank(type)) {
|
|
34 |
protected void setType(final DLIResolvedObject object, final String type) {
|
|
35 |
if (!StringUtils.isBlank(type)) {
|
|
35 | 36 |
if (datasetSubTypes.contains(type.toLowerCase())) { |
36 | 37 |
object.setType(ObjectType.dataset); |
37 | 38 |
return; |
Also available in: Unified diff
Refactored Pid resolver