Package org.w3c.its

Interface ITraversal

  • All Known Implementing Classes:
    ITSEngine

    public interface ITraversal
    Provides the methods traverse a document and access the ITS data category available on each node.
    • Field Detail

      • DIR_LTR

        static final int DIR_LTR
        Flag indicating a Left-To-Right directionality.
        See Also:
        Constant Field Values
      • DIR_RTL

        static final int DIR_RTL
        Flag indicating a Right-To-Left directionality.
        See Also:
        Constant Field Values
      • DIR_LRO

        static final int DIR_LRO
        Flag indicating a Left-To-Right directionality override.
        See Also:
        Constant Field Values
      • DIR_RLO

        static final int DIR_RLO
        Flag indicating a Right-To-Left directionality override.
        See Also:
        Constant Field Values
      • WITHINTEXT_NO

        static final int WITHINTEXT_NO
        Flag indicating an element that is not within text.
        See Also:
        Constant Field Values
      • WITHINTEXT_YES

        static final int WITHINTEXT_YES
        Flag indicating an element that is within text (inline).
        See Also:
        Constant Field Values
      • WITHINTEXT_NESTED

        static final int WITHINTEXT_NESTED
        Flag indicating an element that is nested.
        See Also:
        Constant Field Values
    • Method Detail

      • startTraversal

        void startTraversal()
        Starts the traversal of the document. This method must be called once before you call nextNode().
      • nextNode

        Node nextNode()
        Moves to the next node in the traversal of the document.
        Returns:
        the current node of the traversal. Null if the document is traversed.
      • backTracking

        boolean backTracking()
        Indicates whether the current node is found while backtracking. For example, for an element node, this indicate the equivalent of a closing tag.
        Returns:
        true if the current node is found while backtracking, false otherwise.
      • getTranslate

        boolean getTranslate​(Attr attribute)
        Indicates if the current element or one of its attributes is translatable.
        Parameters:
        attribute - the attribute to query or null to query the element.
        Returns:
        true if the queried element or attribute is translatable, false otherwise.
      • getTargetPointer

        String getTargetPointer​(Attr attribute)
        Gets the target pointer for the current element of the traversal or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the element.
        Returns:
        the XPath relative to the current element or attribute to the node where the translation should be placed.
      • getIdValue

        String getIdValue​(Attr attribute)
        Gets the id value for the current element of the traversal or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the element. This method is used for both the ITS 2.0 feature and the deprecated extension to ITS 1.0.
        Returns:
        the value of the identifier for the queried part.
      • getDirectionality

        int getDirectionality​(Attr attribute)
        Gets the directionality for the text of a given attribute of the current node of the traversal.
        Parameters:
        attribute - the attribute to query or null to query the element.
        Returns:
        the directionality information (DIR_LTR, DIR_RTL, DIR_LRO or DIR_RLO) for the queried part.
      • getExternalResourceRef

        String getExternalResourceRef​(Attr attribute)
        Gets the external resource reference for the current element of the traversal or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the element.
        Returns:
        the external resource reference for the queried part, or null.
      • getLocQualityIssuesRef

        String getLocQualityIssuesRef​(Attr attribute)
        Gets the standoff location of the Localization Quality Issue records for the current element or one of its attributes.
        Parameters:
        attribute - the attribute to query, or null to query the current element.
        Returns:
        the standoff location of the records for the queried parts (can be null).
      • getLocQualityIssueCount

        int getLocQualityIssueCount​(Attr attribute)
        Gets the number of Localization Quality Issue annotations for the current element or one of its attributes.
        Parameters:
        attribute - the attribute to query, or null to query the current element.
        Returns:
        the number of issues for the queried part.
      • getLocQualityIssueType

        String getLocQualityIssueType​(Attr attribute,
                                      int index)
        Gets the type of the Localization Quality Issue instance for the current element or one of its attribute, for the given index.
        Parameters:
        attribute - the attribute to query, or null to query the current element.
        index - the index of the issue in the list (zero-based).
        Returns:
        the type for the issue at the given index for the queried part (can be null).
        See Also:
        getLocQualityIssueCount(Attr)
      • getLocQualityIssueComment

        String getLocQualityIssueComment​(Attr attribute,
                                         int index)
        Gets the comment of the Localization Quality Issue instance for the current element or one of its attribute, for the given index.
        Parameters:
        attribute - the attribute to query, or null to query the current element.
        index - the index of the issue in the list (zero-based).
        Returns:
        the comment for the issue at the given index for the queried part (can be null).
        See Also:
        getLocQualityIssueCount(Attr)
      • getLocQualityIssueSeverity

        Double getLocQualityIssueSeverity​(Attr attribute,
                                          int index)
        Gets the severity of the Localization Quality Issue instance for the current element or one of its attribute, for the given index.
        Parameters:
        attribute - the attribute to query, or null to query the current element.
        index - the index of the issue in the list (zero-based).
        Returns:
        the severity for the issue at the given index for the queried part (can be null).
        See Also:
        getLocQualityIssueCount(Attr)
      • getLocQualityIssueProfileRef

        String getLocQualityIssueProfileRef​(Attr attribute,
                                            int index)
        Gets the comment of the Localization Quality Issue instance for the current element or one of its attribute, for the given index.
        Parameters:
        attribute - the attribute to query, or null to query the current element.
        index - the index of the issue in the list (zero-based).
        Returns:
        the comment for the issue at the given index for the queried part (can be null).
        See Also:
        getLocQualityIssueCount(Attr)
      • getLocQualityIssueEnabled

        Boolean getLocQualityIssueEnabled​(Attr attribute,
                                          int index)
        Gets the enabled/disabled flag of the Localization Quality Issue instance for the current element or one of its attribute, for the given index.
        Parameters:
        attribute - the attribute to query, or null to query the current element.
        index - the index of the issue in the list (zero-based).
        Returns:
        the enabled/disabled flag for the issue at the given index for the queried part (can be null).
        See Also:
        getLocQualityIssueCount(Attr)
      • getWithinText

        int getWithinText()
        Gets the element-withinText-related information for the current element. This data category applies only to elements.
        Returns:
        One of the WINTINTEXT_* values.
      • getTerm

        boolean getTerm​(Attr attribute)
        Indicates if a given attribute of the current element of the traversal or one of its attributes is a term.
        Parameters:
        attribute - The attribute to query or null for the element.
        Returns:
        True if the queried part is a term, false otherwise.
      • getTermInfo

        String getTermInfo​(Attr attribute)
        Gets the information associated with a given term node or one of its attributes.
        Parameters:
        attribute - The attribute to query or null for the element.
        Returns:
        the information associated with the queried part.
      • getTermConfidence

        Double getTermConfidence​(Attr attribute)
        Gets the confidence associated with a given term node or one of its attributes.
        Parameters:
        attribute - The attribute to query or null for the element.
        Returns:
        the confidence associated with the queried part.
      • getLocNote

        String getLocNote​(Attr attribute)
        Gets the localization note of the current element of the traversal or one of its attributes.
        Parameters:
        attribute - the attribute to query or null for the element.
        Returns:
        The localization note of the queried part.
      • getLocNoteType

        String getLocNoteType​(Attr attribute)
      • getDomains

        String getDomains​(Attr attribute)
        Gets the domain or domains for the current element or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the current element.
        Returns:
        a comma-separated string representing the list of domains for the queried part. See http://www.w3.org/TR/its20/#domain-implementation for details on the format of the string.
      • getLocaleFilter

        String getLocaleFilter()
        Gets the locale filter information.
        Returns:
        A a comma-separated list of extended language ranges as defined in BCP-47 (and possibly empty). If the first character is '!' the type is 'exclude' otherwise the type is 'include'.
      • preserveWS

        boolean preserveWS​(Attr attribute)
        Indicates if the white spaces of the current element of the traversal or the given attribute must be preserved.
        Returns:
        True if the white spaces of the current element or the given attribute must be preserve, false if they may or may not be preserved.
      • getLanguage

        String getLanguage()
        Gets the language for the current element of the traversal and its attributes.
        Returns:
        The language code for the current element and its attributes.
      • getStorageSize

        Integer getStorageSize​(Attr attribute)
        Gets the storage size for the current element or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the current element.
        Returns:
        the storage size for the queried part.
      • getStorageEncoding

        String getStorageEncoding​(Attr attribute)
        Gets the storage encoding for the current element or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the current element.
        Returns:
        the storage encoding for the queried part.
      • getLineBreakType

        String getLineBreakType​(Attr attribute)
        Gets the storage line-break type for the current element or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the current element.
        Returns:
        the storage line-break type for the queried part.
      • getAllowedCharacters

        String getAllowedCharacters​(Attr attribute)
        Gets the pattern of allowed characters for the current element or one of its attributes.
        Parameters:
        attribute - the attribute to query or null to query the current element.
        Returns:
        the pattern of allowed characters for the queried part.
      • getAnnotatorsRef

        String getAnnotatorsRef()
        Gets the tools references associated with the current element of the traversal and its attributes.

        The returned value is sorted by data category and hold all data categories within scope (not just the ones set on the given node).

        Returns:
        the tools references associated with the current element of the traversal and its attributes.
      • getAnnotatorRef

        String getAnnotatorRef​(String dc)
        Gets the annotator reference for a given data category.
        Parameters:
        dc - the name of the data category to look up.
        Returns:
        the reference for the given data category, or null.
      • getMtConfidence

        Double getMtConfidence​(Attr attribute)
        Gets the MT Confidence value for the current element of the traversal or one of its attributes.
        Parameters:
        attribute - the attribute to query or null for the element.
        Returns:
        the MT Confidence value or null if none is set.
      • getTextAnalysisClass

        String getTextAnalysisClass​(Attr attribute)
      • getTextAnalysisSource

        String getTextAnalysisSource​(Attr attribute)
      • getTextAnalysisIdent

        String getTextAnalysisIdent​(Attr attribute)
      • getTextAnalysisConfidence

        Double getTextAnalysisConfidence​(Attr attribute)
      • getLocQualityRatingScore

        Double getLocQualityRatingScore​(Attr attribute)
      • getLocQualityRatingVote

        Integer getLocQualityRatingVote​(Attr attribute)
      • getLocQualityRatingScoreThreshold

        Double getLocQualityRatingScoreThreshold​(Attr attribute)
      • getLocQualityRatingVoteThreshold

        Integer getLocQualityRatingVoteThreshold​(Attr attribute)
      • getLocQualityRatingProfileRef

        String getLocQualityRatingProfileRef​(Attr attribute)
      • getProvRecordsRef

        String getProvRecordsRef​(Attr attribute)
      • getProvRecordCount

        int getProvRecordCount​(Attr attribute)
      • getProvPerson

        String getProvPerson​(Attr attribute,
                             int index)
      • getProvOrg

        String getProvOrg​(Attr attribute,
                          int index)
      • getProvTool

        String getProvTool​(Attr attribute,
                           int index)
      • getProvRevPerson

        String getProvRevPerson​(Attr attribute,
                                int index)
      • getProvRevOrg

        String getProvRevOrg​(Attr attribute,
                             int index)
      • getProvRevTool

        String getProvRevTool​(Attr attribute,
                              int index)
      • getProvRef

        String getProvRef​(Attr attribute,
                          int index)