- Timestamp:
- 10/28/14 13:42:26 (10 years ago)
- Location:
- SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/ClarinFCSClientBuilder.java
r5748 r5749 57 57 58 58 /** 59 * Parse unknown data views into a DOM.59 * Configure client to parse unknown Data Views into a DOM representation. 60 60 * 61 61 * @return this {@link ClarinFCSClientBuilder} instance 62 62 * @see DataViewParserGenericDOM 63 * @see DataViewGenericDOM 63 64 */ 64 65 public ClarinFCSClientBuilder unknownDataViewAsDOM() { … … 69 70 70 71 /** 71 * Parse unknown data views into a String. 72 * Configure client to parse unknown Data Views into a String 73 * representation. 72 74 * 73 75 * @return this {@link ClarinFCSClientBuilder} instance 74 76 * @see DataViewParserGenericString 77 * @see DataViewGenericString 75 78 */ 76 79 public ClarinFCSClientBuilder unknownDataViewAsString() { … … 99 102 100 103 /** 101 * Enable support for legacy CLARIN-FCS endpoints.104 * Configure client to enable support for legacy CLARIN-FCS endpoints. 102 105 * 103 106 * @return this {@link ClarinFCSClientBuilder} instance … … 110 113 111 114 /** 112 * Disable support for legacy CLARIN-FCS endpoints.115 * Configure client to disable support for legacy CLARIN-FCS endpoints. 113 116 * 114 117 * @return this {@link ClarinFCSClientBuilder} instance … … 184 187 185 188 /** 186 * Register a data view parser.189 * Register a Data View parser. 187 190 * 188 191 * @param parser … … 191 194 * @throws IllegalArgumentException 192 195 * if an error occurred while registering the data view parser 196 * @see DataViewParser 193 197 */ 194 198 public ClarinFCSClientBuilder registerDataViewParser(DataViewParser parser) { … … 200 204 throw new IllegalArgumentException("parsers of type '" + 201 205 parser.getClass().getName() + 202 "' shouldnot be added manually");206 "' cannot be added manually"); 203 207 } 204 208 … … 257 261 258 262 263 @SuppressWarnings("deprecation") 259 264 private List<DataViewParser> finalizeDataViewParsers() { 260 265 final List<DataViewParser> result = -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataView.java
r2467 r5749 18 18 19 19 /** 20 * Base class for Data View implementations according to the CLARIN-FCS record20 * Base class for Data View implementations according to the CLARIN-FCS record 21 21 * schema. 22 22 */ -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewGenericDOM.java
r2467 r5749 21 21 22 22 /** 23 * A generic DataView implementation that stores the content as a DOM document. 23 * A generic Data View implementation that stores the content of the Data View 24 * as a DOM document. 24 25 */ 25 26 public class DataViewGenericDOM extends DataView { -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewGenericString.java
r2467 r5749 18 18 19 19 /** 20 * A generic DataView implementation that stores the content as a String. 20 * A generic Data View implementation that stores the content of a Data View as 21 * a String. 21 22 */ 22 23 public class DataViewGenericString extends DataView { -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewHits.java
r5743 r5749 1 1 package eu.clarin.sru.client.fcs; 2 2 3 /** 4 * A Data View implementation that stores the content of a HITS Data View. 5 */ 3 6 public class DataViewHits extends DataView { 4 7 /** … … 55 58 56 59 60 /** 61 * Get the total number of hits in the result. 62 * @return the number of hits 63 */ 57 64 public int getHitCount() { 58 65 return max_offset; … … 60 67 61 68 69 /** 70 * Get the text content of the hit. Usually this is complete sentence. 71 * 72 * @return the text content of the hit 73 */ 62 74 public String getText() { 63 75 return text; … … 65 77 66 78 79 /** 80 * Get the offsets pointing to range in the text content that yield the hit. 81 * 82 * @param idx 83 * the hit to retrieve. Must be larger than <code>0</code> and 84 * smaller than the result of {@link #getHitCount()}. 85 * @return An array of two elements. The first array element is the start 86 * offset, the second array element is the end offset of the hit 87 * range. 88 * @throws ArrayIndexOutOfBoundsException 89 * of the <code>idx</code> argument is out of bounds. 90 */ 67 91 public int[] getHitOffsets(int idx) { 68 92 if (idx < 0) { 69 throw new IllegalArgumentException("idx < 0");93 throw new ArrayIndexOutOfBoundsException("idx < 0"); 70 94 } 71 95 if (idx < max_offset) { -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParser.java
r2467 r5749 24 24 25 25 /** 26 * Base class for implementing parsers for parsing a specific DataView in a 27 * CLARIN-FCS record. 28 * <p>If multiple record parsers support a certain type, the one 29 * with the highest priority is selected.</p> 26 * Base class for implementing parsers for parsing a specific Data View embedded 27 * in a CLARIN-FCS record. 28 * <p> 29 * If multiple record parsers support a certain type, the one with the highest 30 * priority is selected. 31 * </p> 30 32 */ 31 33 public interface DataViewParser { -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserGenericDOM.java
r2467 r5749 35 35 36 36 37 /** 38 * An implementation of a Data View parser that stores the content of a Data 39 * View in DOM representation. 40 * 41 * @see DataViewGenericDOM 42 */ 37 43 public class DataViewParserGenericDOM implements DataViewParser { 38 44 private static class TransformHelper { -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserGenericString.java
r2467 r5749 27 27 28 28 29 /** 30 * An implementation of a DataView parser that stores the content of a Data 31 * Views in String representation. 32 * 33 * @see DataViewGenericString 34 */ 29 35 public class DataViewParserGenericString implements DataViewParser { 30 36 private static final XMLOutputFactory factory = -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserHits.java
r5743 r5749 13 13 14 14 15 /** 16 * An implementation of a Data View parser that parses HITS Data Views. This 17 * parser expects input that conforms to the CLARIN-FCS specification for the 18 * HITS Data View. 19 * 20 * @see DataViewHits 21 */ 15 22 public final class DataViewParserHits implements DataViewParser { 16 23 private static final int OFFSET_CHUNK_SIZE = 8; -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserKWIC.java
r5743 r5749 26 26 import eu.clarin.sru.client.XmlStreamReaderUtils; 27 27 28 29 /** 30 * An implementation of a Data View parser that parses legacy KWIC Data Views. 31 * The input will automatically be upgraded to a HITS Data View and an instance 32 * of {@link DataViewHits} will be returned. 33 * 34 * @see DataViewHits 35 * @deprecated Use only to talk to legacy clients. Endpoints should upgrade to 36 * recent CLARIN-FCS specification. 37 */ 38 @Deprecated 28 39 public class DataViewParserKWIC implements DataViewParser { 29 40 private static final String FCS_KWIC_NS = "http://clarin.eu/fcs/1.0/kwic"; -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/LegacyClarinFCSRecordDataParser.java
r5743 r5749 13 13 * A record data parse to parse legacy records. 14 14 * 15 * @deprecated Use only to talk to legacy clients 15 * @deprecated Use only to talk to legacy clients. Endpoints should upgrade to 16 * recent CLARIN-FCS specification. 16 17 */ 17 18 @Deprecated
Note: See TracChangeset
for help on using the changeset viewer.