1 | package eu.clarin.sru.client.fcs; |
---|
2 | |
---|
3 | import java.util.List; |
---|
4 | |
---|
5 | import javax.xml.stream.XMLStreamException; |
---|
6 | import javax.xml.stream.XMLStreamReader; |
---|
7 | |
---|
8 | import eu.clarin.sru.client.SRUClientException; |
---|
9 | import eu.clarin.sru.client.SRURecordData; |
---|
10 | |
---|
11 | |
---|
12 | /** |
---|
13 | * A record data parse to parse legacy records. |
---|
14 | * |
---|
15 | * @deprecated Use only to talk to legacy clients |
---|
16 | */ |
---|
17 | @Deprecated |
---|
18 | public class LegacyClarinFCSRecordDataParser extends |
---|
19 | AbstractClarinFCSRecordDataParser { |
---|
20 | |
---|
21 | |
---|
22 | /** |
---|
23 | * Constructor. |
---|
24 | * |
---|
25 | * @param parsers |
---|
26 | * the list of data view parsers to be used by this record data |
---|
27 | * parser. This list should contain one |
---|
28 | * {@link DataViewParserGenericDOM} or |
---|
29 | * {@link DataViewParserGenericString} instance. |
---|
30 | * @throws NullPointerException |
---|
31 | * if parsers is <code>null</code> |
---|
32 | * @throws IllegalArgumentException |
---|
33 | * if parsers is empty or contains duplicate entries |
---|
34 | */ |
---|
35 | public LegacyClarinFCSRecordDataParser(List<DataViewParser> parsers) { |
---|
36 | super(parsers); |
---|
37 | } |
---|
38 | |
---|
39 | |
---|
40 | @Override |
---|
41 | public String getRecordSchema() { |
---|
42 | return ClarinFCSRecordData.LEGACY_RECORD_SCHEMA; |
---|
43 | } |
---|
44 | |
---|
45 | |
---|
46 | @Override |
---|
47 | public SRURecordData parse(XMLStreamReader reader) |
---|
48 | throws XMLStreamException, SRUClientException { |
---|
49 | logger.warn("The endpoint supplied data in the deprecated CLARIN-FCS " + |
---|
50 | "record data format. Please upgrade to the new CLARIN-FCS " + |
---|
51 | "specification as soon as possible."); |
---|
52 | return parse(reader, ClarinFCSRecordData.LEGACY_RECORD_SCHEMA); |
---|
53 | } |
---|
54 | |
---|
55 | } // class LegacyClarinFCSRecordDataParser |
---|