Last change
on this file since 1971 was
1971,
checked in by oschonef, 12 years ago
|
- work-in-progress
- fix breakage from last commit
- add request objects with all relevant parameters
- add handling of surrogate diagnostic record data
- add handler callbacks for parsing extraTermData and extraRecordData
|
-
Property svn:eol-style set to
native
|
File size:
1.3 KB
|
Line | |
---|
1 | package eu.clarin.sru.client; |
---|
2 | |
---|
3 | public final class SRUExplainRequest extends SRUAbstractRequest { |
---|
4 | private SRURecordPacking recordPacking; |
---|
5 | |
---|
6 | |
---|
7 | protected SRUExplainRequest(String baseURI) { |
---|
8 | super(baseURI); |
---|
9 | } |
---|
10 | |
---|
11 | |
---|
12 | public void setRecordPacking(SRURecordPacking recordPacking) { |
---|
13 | if (recordPacking == null) { |
---|
14 | throw new NullPointerException("recordPacking == null"); |
---|
15 | } |
---|
16 | this.recordPacking = recordPacking; |
---|
17 | } |
---|
18 | |
---|
19 | |
---|
20 | public SRURecordPacking getRecordPacking() { |
---|
21 | return recordPacking; |
---|
22 | } |
---|
23 | |
---|
24 | |
---|
25 | @Override |
---|
26 | protected SRUOperation getOperation() { |
---|
27 | return SRUOperation.EXPLAIN; |
---|
28 | } |
---|
29 | |
---|
30 | |
---|
31 | @Override |
---|
32 | protected void addParametersToURI(StringBuilder uri) |
---|
33 | throws SRUClientException { |
---|
34 | // recordPacking |
---|
35 | if (recordPacking != null) { |
---|
36 | uri.append('&').append(PARAM_RECORD_PACKING).append('='); |
---|
37 | switch (recordPacking) { |
---|
38 | case XML: |
---|
39 | uri.append(RECORD_PACKING_XML); |
---|
40 | break; |
---|
41 | case STRING: |
---|
42 | uri.append(RECORD_PACKING_STRING); |
---|
43 | break; |
---|
44 | default: |
---|
45 | throw new SRUClientException("unsupported record packing: " + |
---|
46 | recordPacking); |
---|
47 | } // switch |
---|
48 | } |
---|
49 | } |
---|
50 | |
---|
51 | } // class SRUExplainRequest |
---|
Note: See
TracBrowser
for help on using the repository browser.