Changeset 7280
- Timestamp:
- 01/10/22 12:10:08 (3 years ago)
- Location:
- FCSSimpleClient/trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/AbstractClarinFCSRecordDataParser.java
r7274 r7280 64 64 } 65 65 66 ArrayList<DataViewParser> list = new ArrayList< DataViewParser>();66 ArrayList<DataViewParser> list = new ArrayList<>(); 67 67 boolean foundGeneric = false; 68 68 for (DataViewParser parser : parsers) { … … 172 172 if (dataview != null) { 173 173 if (dataviews == null) { 174 dataviews = new LinkedList< DataView>();174 dataviews = new LinkedList<>(); 175 175 } 176 176 dataviews.add(dataview); … … 196 196 197 197 if (resourceFragments == null) { 198 resourceFragments = new LinkedList< Resource.ResourceFragment>();198 resourceFragments = new LinkedList<>(); 199 199 } 200 200 resourceFragments.add(new Resource.ResourceFragment(pid, ref, dataviews)); -
FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/ClarinFCSClientBuilder.java
r7274 r7280 20 20 import java.util.List; 21 21 22 import eu.clarin.sru.client.SRURequestAuthenticator;23 22 import eu.clarin.sru.client.SRUClient; 24 23 import eu.clarin.sru.client.SRUClientConfig; 25 24 import eu.clarin.sru.client.SRUExtraResponseDataParser; 25 import eu.clarin.sru.client.SRURequestAuthenticator; 26 26 import eu.clarin.sru.client.SRUSimpleClient; 27 27 import eu.clarin.sru.client.SRUThreadedClient; … … 39 39 private static final SRUVersion DEFAULT_SRU_VERSION = 40 40 SRUVersion.VERSION_1_2; 41 private List<DataViewParser> parsers = new ArrayList< DataViewParser>();41 private List<DataViewParser> parsers = new ArrayList<>(); 42 42 private List<SRUExtraResponseDataParser> extraDataParsers = 43 new ArrayList< SRUExtraResponseDataParser>();43 new ArrayList<>(); 44 44 private SRUVersion defaultVersion = DEFAULT_SRU_VERSION; 45 45 private boolean unknownAsDom = DEFAULT_UNKNOWN_AS_DOM; … … 49 49 private int socketTimeout = SRUClientConfig.DEFAULT_SOCKET_TIMEOUT; 50 50 private SRURequestAuthenticator requestAuthStrategy; 51 51 52 52 53 53 /** … … 354 354 private List<DataViewParser> finalizeDataViewParsers() { 355 355 final List<DataViewParser> result = 356 new ArrayList< DataViewParser>(parsers.size() +356 new ArrayList<>(parsers.size() + 357 357 (legacySupport ? 2 : 1)); 358 358 result.addAll(parsers); -
FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/ClarinFCSEndpointDescriptionParser.java
r7274 r7280 127 127 final URI uri = new URI(s); 128 128 if (capabilities == null) { 129 capabilities = new ArrayList< URI>();129 capabilities = new ArrayList<>(); 130 130 } 131 131 capabilities.add(uri); … … 189 189 } 190 190 } else { 191 supportedDataViews = new ArrayList< DataView>();191 supportedDataViews = new ArrayList<>(); 192 192 } 193 193 supportedDataViews.add(new DataView(id, type, policy)); … … 261 261 XmlStreamReaderUtils.readEnd(reader, ED_NS_URI, "SupportedLayer"); 262 262 if (supportedLayers == null) { 263 supportedLayers = new ArrayList< Layer>();263 supportedLayers = new ArrayList<>(); 264 264 } 265 265 supportedLayers.add(new Layer(id, resultId, layer, … … 336 336 337 337 logger.debug("hasAdvSearch: {}", hasAdvancedSearch); 338 338 339 339 logger.debug("parsing resource with pid = {}", pid); 340 340 … … 361 361 XmlStreamReaderUtils.readEnd(reader, ED_NS_URI, "Language"); 362 362 if (languages == null) { 363 languages = new ArrayList< String>();363 languages = new ArrayList<>(); 364 364 } else { 365 365 for (String l : languages) { … … 389 389 found = true; 390 390 if (dataviews == null) { 391 dataviews = new ArrayList< DataView>();391 dataviews = new ArrayList<>(); 392 392 } 393 393 dataviews.add(dataview); … … 420 420 found = true; 421 421 if (layers == null) { 422 layers = new ArrayList< Layer>();422 layers = new ArrayList<>(); 423 423 } 424 424 layers.add(layer); … … 475 475 476 476 if (resources == null) { 477 resources = new ArrayList< ResourceInfo>();477 resources = new ArrayList<>(); 478 478 } 479 479 resources.add(new ResourceInfo(pid, title, description, … … 497 497 final String content = XmlStreamReaderUtils.readString(reader, true); 498 498 if (result == null) { 499 result = new HashMap< String, String>();499 result = new HashMap<>(); 500 500 } 501 501 if (result.containsKey(lang)) { -
FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserAdvanced.java
r7274 r7280 72 72 73 73 // Segments 74 final Map<String, DataViewAdvanced.Segment> segments = 75 new HashMap<String, DataViewAdvanced.Segment>(); 74 final Map<String, DataViewAdvanced.Segment> segments = new HashMap<>(); 76 75 XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Segments", true); 77 76 while (XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Segment", … … 98 97 // Layers 99 98 List<DataViewAdvanced.Layer> layers = 100 new ArrayList< DataViewAdvanced.Layer>();99 new ArrayList<>(); 101 100 102 101 XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Layers", true); … … 108 107 109 108 final List<DataViewAdvanced.Span> spans = 110 new ArrayList< DataViewAdvanced.Span>();109 new ArrayList<>(); 111 110 while (XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Span", 112 111 spans.isEmpty(), true)) { -
FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserGenericString.java
r7274 r7280 18 18 19 19 import java.io.StringWriter; 20 20 21 import javax.xml.stream.XMLOutputFactory; 21 22 import javax.xml.stream.XMLStreamConstants; -
FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/LegacyClarinFCSRecordDataParser.java
r7274 r7280 37 37 private final boolean fullLegacyCompatMode; 38 38 39 39 40 40 /** 41 41 * Constructor. -
FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestClient.java
r7274 r7280 29 29 import eu.clarin.sru.client.SRUSearchRetrieveResponse; 30 30 import eu.clarin.sru.client.SRUVersion; 31 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;32 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescriptionParser;33 31 34 32 -
FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestSimpleClient.java
r7274 r7280 32 32 import eu.clarin.sru.client.SRUSimpleClient; 33 33 import eu.clarin.sru.client.SRUWhereInList; 34 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;35 import eu.clarin.sru.client.fcs.ClarinFCSRecordData;36 34 37 35 -
FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestThreadedClient.java
r7274 r7280 30 30 import eu.clarin.sru.client.SRUSearchRetrieveResponse; 31 31 import eu.clarin.sru.client.SRUThreadedClient; 32 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;33 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescriptionParser;34 32 35 33 @Deprecated -
FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestThreadedClientCallback.java
r7274 r7280 31 31 import eu.clarin.sru.client.SRUSearchRetrieveResponse; 32 32 import eu.clarin.sru.client.SRUThreadedClient; 33 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;34 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescriptionParser;35 33 36 34 -
FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestUtils.java
r7274 r7280 26 26 import eu.clarin.sru.client.SRUDiagnostic; 27 27 import eu.clarin.sru.client.SRUExplainRecordData; 28 import eu.clarin.sru.client.SRUExplainRecordData.ConfigInfo; 29 import eu.clarin.sru.client.SRUExplainRecordData.Schema; 28 30 import eu.clarin.sru.client.SRUExplainRequest; 29 31 import eu.clarin.sru.client.SRUExplainResponse; … … 39 41 import eu.clarin.sru.client.SRUSurrogateRecordData; 40 42 import eu.clarin.sru.client.SRUTerm; 41 import eu.clarin.sru.client.SRUExplainRecordData.ConfigInfo;42 import eu.clarin.sru.client.SRUExplainRecordData.Schema;43 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescription;44 43 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescription.ResourceInfo; 45 import eu.clarin.sru.client.fcs.ClarinFCSRecordData;46 import eu.clarin.sru.client.fcs.DataView;47 import eu.clarin.sru.client.fcs.DataViewAdvanced;48 import eu.clarin.sru.client.fcs.DataViewGenericDOM;49 import eu.clarin.sru.client.fcs.DataViewGenericString;50 import eu.clarin.sru.client.fcs.DataViewHits;51 import eu.clarin.sru.client.fcs.Resource;52 44 53 45 class TestUtils {
Note: See TracChangeset
for help on using the changeset viewer.