net.sf.okapi.lib.xliff2.its

## Class ITSReader

- java.lang.Object
- - net.sf.okapi.lib.xliff2.its.ITSReader

-     public class ITSReader
      extends java.lang.Object

  Provides utility methods to read ITS attributes and stand-off elements.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ANNOTATORSREF`
    `static java.lang.String` | `DOMAINS`
    `static java.lang.String` | `LOCQUALITYISSUE`
    `static java.lang.String` | `LOCQUALITYISSUECOMMENT`
    `static java.lang.String` | `LOCQUALITYISSUEENABLED`
    `static java.lang.String` | `LOCQUALITYISSUEPROFILEREF`
    `static java.lang.String` | `LOCQUALITYISSUES`
    `static java.lang.String` | `LOCQUALITYISSUESEVERITY`
    `static java.lang.String` | `LOCQUALITYISSUESREF`
    `static java.lang.String` | `LOCQUALITYISSUETYPE`
    `static java.lang.String` | `MTCONFIDENCE`
    `static java.lang.String` | `PROVENANCERECORD`
    `static java.lang.String` | `PROVENANCERECORDS`
    `static java.lang.String` | `PROVENANCERECORDSREF`
    `static java.lang.String` | `PROVORG`
    `static java.lang.String` | `PROVORGREF`
    `static java.lang.String` | `PROVPERSON`
    `static java.lang.String` | `PROVPERSONREF`
    `static java.lang.String` | `PROVREF`
    `static java.lang.String` | `PROVREVORG`
    `static java.lang.String` | `PROVREVORGREF`
    `static java.lang.String` | `PROVREVPERSON`
    `static java.lang.String` | `PROVREVPERSONREF`
    `static java.lang.String` | `PROVREVTOOL`
    `static java.lang.String` | `PROVREVTOOLREF`
    `static java.lang.String` | `PROVTOOL`
    `static java.lang.String` | `PROVTOOLREF`
    `static java.lang.String` | `TACLASSREF`
    `static java.lang.String` | `TACONFIDENCE`
    `static java.lang.String` | `TAIDENT`
    `static java.lang.String` | `TAIDENTREF`
    `static java.lang.String` | `TASOURCE`
    `static java.lang.String` | `TERMCONFIDENCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ITSReader(javax.xml.stream.XMLStreamReader reader)` Creates a new `ITSReader` object for a given reader.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `fetchUnresolvedITSGroups(IWithITSAttributes parent)` Tries to resolve any un-resolved reference to ITS stand-off group.
    `AnnotatorsRef` | `readAnnotatorsRef(boolean local, AnnotatorsRef parentAR)` Reads the annotatorsRef attribute from the current element.
    `boolean` | `readAttributes(IWithITSGroups groupHolder, IWithITSAttributes object, AnnotatorsRef ar)` Reads the ITS attributes for the current element.
    `void` | `readStandOffElements(java.lang.String initialLocName, IWithITSGroups groupHolder, AnnotatorsRef ar)` Reads the stand-off ITS elements
    `void` | `readTerminology(TermTag marker, AnnotatorsRef ar)` Reads the ITS attributes for terminology.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ANNOTATORSREF

          public static final java.lang.String ANNOTATORSREF

      See Also:
        Constant Field Values

    - #### MTCONFIDENCE

          public static final java.lang.String MTCONFIDENCE

      See Also:
        Constant Field Values

    - #### DOMAINS

          public static final java.lang.String DOMAINS

      See Also:
        Constant Field Values

    - #### TACONFIDENCE

          public static final java.lang.String TACONFIDENCE

      See Also:
        Constant Field Values

    - #### TACLASSREF

          public static final java.lang.String TACLASSREF

      See Also:
        Constant Field Values

    - #### TASOURCE

          public static final java.lang.String TASOURCE

      See Also:
        Constant Field Values

    - #### TAIDENT

          public static final java.lang.String TAIDENT

      See Also:
        Constant Field Values

    - #### TAIDENTREF

          public static final java.lang.String TAIDENTREF

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUES

          public static final java.lang.String LOCQUALITYISSUES

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUE

          public static final java.lang.String LOCQUALITYISSUE

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUETYPE

          public static final java.lang.String LOCQUALITYISSUETYPE

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUECOMMENT

          public static final java.lang.String LOCQUALITYISSUECOMMENT

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUEENABLED

          public static final java.lang.String LOCQUALITYISSUEENABLED

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUESEVERITY

          public static final java.lang.String LOCQUALITYISSUESEVERITY

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUEPROFILEREF

          public static final java.lang.String LOCQUALITYISSUEPROFILEREF

      See Also:
        Constant Field Values

    - #### LOCQUALITYISSUESREF

          public static final java.lang.String LOCQUALITYISSUESREF

      See Also:
        Constant Field Values

    - #### PROVENANCERECORDS

          public static final java.lang.String PROVENANCERECORDS

      See Also:
        Constant Field Values

    - #### PROVENANCERECORD

          public static final java.lang.String PROVENANCERECORD

      See Also:
        Constant Field Values

    - #### PROVTOOL

          public static final java.lang.String PROVTOOL

      See Also:
        Constant Field Values

    - #### PROVTOOLREF

          public static final java.lang.String PROVTOOLREF

      See Also:
        Constant Field Values

    - #### PROVREVTOOL

          public static final java.lang.String PROVREVTOOL

      See Also:
        Constant Field Values

    - #### PROVREVTOOLREF

          public static final java.lang.String PROVREVTOOLREF

      See Also:
        Constant Field Values

    - #### PROVPERSON

          public static final java.lang.String PROVPERSON

      See Also:
        Constant Field Values

    - #### PROVPERSONREF

          public static final java.lang.String PROVPERSONREF

      See Also:
        Constant Field Values

    - #### PROVREVPERSON

          public static final java.lang.String PROVREVPERSON

      See Also:
        Constant Field Values

    - #### PROVREVPERSONREF

          public static final java.lang.String PROVREVPERSONREF

      See Also:
        Constant Field Values

    - #### PROVORG

          public static final java.lang.String PROVORG

      See Also:
        Constant Field Values

    - #### PROVORGREF

          public static final java.lang.String PROVORGREF

      See Also:
        Constant Field Values

    - #### PROVREVORG

          public static final java.lang.String PROVREVORG

      See Also:
        Constant Field Values

    - #### PROVREVORGREF

          public static final java.lang.String PROVREVORGREF

      See Also:
        Constant Field Values

    - #### PROVREF

          public static final java.lang.String PROVREF

      See Also:
        Constant Field Values

    - #### PROVENANCERECORDSREF

          public static final java.lang.String PROVENANCERECORDSREF

      See Also:
        Constant Field Values

    - #### TERMCONFIDENCE

          public static final java.lang.String TERMCONFIDENCE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ITSReader

          public ITSReader(javax.xml.stream.XMLStreamReader reader)

      Creates a new `ITSReader` object for a given reader.
      Parameters:
        `reader` - the XML stream reader to associate with this object.

  - ### Method Detail

    - #### readStandOffElements

          public void readStandOffElements(java.lang.String initialLocName,
                                  IWithITSGroups groupHolder,
                                  AnnotatorsRef ar)
                                    throws javax.xml.stream.XMLStreamException

      Reads the stand-off ITS elements
      Parameters:
        `initialLocName` - name of the element on which the method is called.
        `groupHolder` - object where the group is located.
        `ar` - the annotator reference context.
      Throws:
        `javax.xml.stream.XMLStreamException` - if a reading error occurs.

    - #### readAttributes

          public boolean readAttributes(IWithITSGroups groupHolder,
                               IWithITSAttributes object,
                               AnnotatorsRef ar)

      Reads the ITS attributes for the current element.
      Parameters:
        `groupHolder` - the object where any stand-off group for the object being looked at is expected to be.
        `object` - the object where to read from.
        `ar` - the current annotators references (can be null).
      Returns:
        true if one or more of the ITS items read has an unresolved stand-off reference.

    - #### readTerminology

          public void readTerminology(TermTag marker,
                             AnnotatorsRef ar)

      Reads the ITS attributes for terminology.
      Parameters:
        `marker` - the marker where to set the information
        `ar` - the current annotators references (can be null).

    - #### fetchUnresolvedITSGroups

          public void fetchUnresolvedITSGroups(IWithITSAttributes parent)

      Tries to resolve any un-resolved reference to ITS stand-off group.
      Parameters:
        `parent` - the object where the attribute(s) referencing the stand-off group is.

    - #### readAnnotatorsRef

          public AnnotatorsRef readAnnotatorsRef(boolean local,
                                        AnnotatorsRef parentAR)

      Reads the annotatorsRef attribute from the current element.
      Parameters:
        `local` - true to use the local namespace, false to use ITS prefix.
        `parentAR` - optional parent values to inherit (can be null).
      Returns:
        the `AnnotatorsRef` object read, or null if none was present.