Changeset 5749 for SRUClient


Ignore:
Timestamp:
10/28/14 13:42:26 (10 years ago)
Author:
Oliver Schonefeld
Message:
  • update javadoc
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  
    5757
    5858    /**
    59      * Parse unknown data views into a DOM.
     59     * Configure client to parse unknown Data Views into a DOM representation.
    6060     *
    6161     * @return this {@link ClarinFCSClientBuilder} instance
    6262     * @see DataViewParserGenericDOM
     63     * @see DataViewGenericDOM
    6364     */
    6465    public ClarinFCSClientBuilder unknownDataViewAsDOM() {
     
    6970
    7071    /**
    71      * Parse unknown data views into a String.
     72     * Configure client to parse unknown Data Views into a String
     73     * representation.
    7274     *
    7375     * @return this {@link ClarinFCSClientBuilder} instance
    7476     * @see DataViewParserGenericString
     77     * @see DataViewGenericString
    7578     */
    7679    public ClarinFCSClientBuilder unknownDataViewAsString() {
     
    99102
    100103    /**
    101      * Enable support for legacy CLARIN-FCS endpoints.
     104     * Configure client to enable support for legacy CLARIN-FCS endpoints.
    102105     *
    103106     * @return this {@link ClarinFCSClientBuilder} instance
     
    110113
    111114    /**
    112      * Disable support for legacy CLARIN-FCS endpoints.
     115     * Configure client to disable support for legacy CLARIN-FCS endpoints.
    113116     *
    114117     * @return this {@link ClarinFCSClientBuilder} instance
     
    184187
    185188    /**
    186      * Register a data view parser.
     189     * Register a Data View parser.
    187190     *
    188191     * @param parser
     
    191194     * @throws IllegalArgumentException
    192195     *             if an error occurred while registering the data view parser
     196     * @see DataViewParser
    193197     */
    194198    public ClarinFCSClientBuilder registerDataViewParser(DataViewParser parser) {
     
    200204            throw new IllegalArgumentException("parsers of type '" +
    201205                    parser.getClass().getName() +
    202                     "' should not be added manually");
     206                    "' cannot be added manually");
    203207        }
    204208
     
    257261
    258262
     263    @SuppressWarnings("deprecation")
    259264    private List<DataViewParser> finalizeDataViewParsers() {
    260265        final List<DataViewParser> result =
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataView.java

    r2467 r5749  
    1818
    1919/**
    20  * Base class for DataView implementations according to the CLARIN-FCS record
     20 * Base class for Data View implementations according to the CLARIN-FCS record
    2121 * schema.
    2222 */
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewGenericDOM.java

    r2467 r5749  
    2121
    2222/**
    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.
    2425 */
    2526public class DataViewGenericDOM extends DataView {
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewGenericString.java

    r2467 r5749  
    1818
    1919/**
    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.
    2122 */
    2223public class DataViewGenericString extends DataView {
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewHits.java

    r5743 r5749  
    11package eu.clarin.sru.client.fcs;
    22
     3/**
     4 * A Data View implementation that stores the content of a HITS Data View.
     5 */
    36public class DataViewHits extends DataView {
    47    /**
     
    5558
    5659
     60    /**
     61     * Get the total number of hits in the result.
     62     * @return the number of hits
     63     */
    5764    public int getHitCount() {
    5865        return max_offset;
     
    6067
    6168
     69    /**
     70     * Get the text content of the hit. Usually this is complete sentence.
     71     *
     72     * @return the text content of the hit
     73     */
    6274    public String getText() {
    6375        return text;
     
    6577
    6678
     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     */
    6791    public int[] getHitOffsets(int idx) {
    6892        if (idx < 0) {
    69             throw new IllegalArgumentException("idx < 0");
     93            throw new ArrayIndexOutOfBoundsException("idx < 0");
    7094        }
    7195        if (idx < max_offset) {
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParser.java

    r2467 r5749  
    2424
    2525/**
    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>
    3032 */
    3133public interface DataViewParser {
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserGenericDOM.java

    r2467 r5749  
    3535
    3636
     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 */
    3743public class DataViewParserGenericDOM implements DataViewParser {
    3844    private static class TransformHelper {
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserGenericString.java

    r2467 r5749  
    2727
    2828
     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 */
    2935public class DataViewParserGenericString implements DataViewParser {
    3036    private static final XMLOutputFactory factory =
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserHits.java

    r5743 r5749  
    1313
    1414
     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 */
    1522public final class DataViewParserHits implements DataViewParser {
    1623    private static final int OFFSET_CHUNK_SIZE = 8;
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserKWIC.java

    r5743 r5749  
    2626import eu.clarin.sru.client.XmlStreamReaderUtils;
    2727
     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
    2839public class DataViewParserKWIC implements DataViewParser {
    2940    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  
    1313 * A record data parse to parse legacy records.
    1414 *
    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.
    1617 */
    1718@Deprecated
Note: See TracChangeset for help on using the changeset viewer.