Package org.w3c.its
Interface ITraversal
-
- All Known Implementing Classes:
ITSEngine
public interface ITraversalProvides the methods traverse a document and access the ITS data category available on each node.
-
-
Field Summary
Fields Modifier and Type Field Description static intDIR_LROFlag indicating a Left-To-Right directionality override.static intDIR_LTRFlag indicating a Left-To-Right directionality.static intDIR_RLOFlag indicating a Right-To-Left directionality override.static intDIR_RTLFlag indicating a Right-To-Left directionality.static intWITHINTEXT_NESTEDFlag indicating an element that is nested.static intWITHINTEXT_NOFlag indicating an element that is not within text.static intWITHINTEXT_YESFlag indicating an element that is within text (inline).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanbackTracking()Indicates whether the current node is found while backtracking.StringgetAllowedCharacters(Attr attribute)Gets the pattern of allowed characters for the current element or one of its attributes.StringgetAnnotatorRef(String dc)Gets the annotator reference for a given data category.StringgetAnnotatorsRef()Gets the tools references associated with the current element of the traversal and its attributes.intgetDirectionality(Attr attribute)Gets the directionality for the text of a given attribute of the current node of the traversal.StringgetDomains(Attr attribute)Gets the domain or domains for the current element or one of its attributes.StringgetExternalResourceRef(Attr attribute)Gets the external resource reference for the current element of the traversal or one of its attributes.StringgetIdValue(Attr attribute)Gets the id value for the current element of the traversal or one of its attributes.StringgetLanguage()Gets the language for the current element of the traversal and its attributes.StringgetLineBreakType(Attr attribute)Gets the storage line-break type for the current element or one of its attributes.StringgetLocaleFilter()Gets the locale filter information.StringgetLocNote(Attr attribute)Gets the localization note of the current element of the traversal or one of its attributes.StringgetLocNoteType(Attr attribute)StringgetLocQualityIssueComment(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.intgetLocQualityIssueCount(Attr attribute)Gets the number of Localization Quality Issue annotations for the current element or one of its attributes.BooleangetLocQualityIssueEnabled(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.StringgetLocQualityIssueProfileRef(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.DoublegetLocQualityIssueSeverity(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.StringgetLocQualityIssuesRef(Attr attribute)Gets the standoff location of the Localization Quality Issue records for the current element or one of its attributes.StringgetLocQualityIssueType(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.StringgetLocQualityRatingProfileRef(Attr attribute)DoublegetLocQualityRatingScore(Attr attribute)DoublegetLocQualityRatingScoreThreshold(Attr attribute)IntegergetLocQualityRatingVote(Attr attribute)IntegergetLocQualityRatingVoteThreshold(Attr attribute)DoublegetMtConfidence(Attr attribute)Gets the MT Confidence value for the current element of the traversal or one of its attributes.StringgetProvOrg(Attr attribute, int index)StringgetProvPerson(Attr attribute, int index)intgetProvRecordCount(Attr attribute)StringgetProvRecordsRef(Attr attribute)StringgetProvRef(Attr attribute, int index)StringgetProvRevOrg(Attr attribute, int index)StringgetProvRevPerson(Attr attribute, int index)StringgetProvRevTool(Attr attribute, int index)StringgetProvTool(Attr attribute, int index)StringgetStorageEncoding(Attr attribute)Gets the storage encoding for the current element or one of its attributes.IntegergetStorageSize(Attr attribute)Gets the storage size for the current element or one of its attributes.StringgetTargetPointer(Attr attribute)Gets the target pointer for the current element of the traversal or one of its attributes.booleangetTerm(Attr attribute)Indicates if a given attribute of the current element of the traversal or one of its attributes is a term.DoublegetTermConfidence(Attr attribute)Gets the confidence associated with a given term node or one of its attributes.StringgetTermInfo(Attr attribute)Gets the information associated with a given term node or one of its attributes.StringgetTextAnalysisClass(Attr attribute)DoublegetTextAnalysisConfidence(Attr attribute)StringgetTextAnalysisIdent(Attr attribute)StringgetTextAnalysisSource(Attr attribute)booleangetTranslate(Attr attribute)Indicates if the current element or one of its attributes is translatable.intgetWithinText()Gets the element-withinText-related information for the current element.NodenextNode()Moves to the next node in the traversal of the document.booleanpreserveWS(Attr attribute)Indicates if the white spaces of the current element of the traversal or the given attribute must be preserved.voidstartTraversal()Starts the traversal of the document.
-
-
-
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 callnextNode().
-
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.
-
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.
-
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.
-
getProvRecordCount
int getProvRecordCount(Attr attribute)
-
-