Class Revisions
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.core.BaseList<Revision>
-
- net.sf.okapi.lib.xliff2.changeTracking.Revisions
-
- All Implemented Interfaces:
Iterable<Revision>,IWithExtAttributes
public class Revisions extends BaseList<Revision> implements IWithExtAttributes
Represents the<revisions>element of the ChangeTracking module.- Author:
- Marta Borriello
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPLIES_TO_ATTR_NAMEappliesToattribute name.static StringCURRENT_VERSION_ATTR_NAMEcurrentVersionattribute name.static StringREF_ATTR_NAMErefattribute name.static StringTAG_NAMEThe tag element name constant.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAppliesTo()Gets the value of the appliesTo attribute.StringgetAttributesString()Gets the attributes string.StringgetClosingTag()Gets the completerevisionsclosing tag.StringgetClosingTagName()Gets the closingchangeTracktag name.StringgetCompleteOpeningTag()Gets the completerevisionsopening tag.StringgetCurrentVersion()Gets the value of thecurrentVersionattribute.ExtAttributesgetExtAttributes()Gets theExtAttributesobject for the parent object.StringgetExtAttributeValue(String namespaceURI, String localName)Gets the value for a given extension attribute.StringgetOpeningTagName()Gets the openingrevisionstag name.StringgetRef()Gets the value for the ref attribute.booleanhasExtAttribute()Indicates if at least one extension attribute is present.voidsetAppliesTo(String appliesTo)Sets the value to theappliesToattribute.voidsetCurrentVersion(String currentVersion)Sets the value of thecurrentVersionattribute.voidsetExtAttributes(ExtAttributes attributes)Sets theExtAttributesobject associated with this object.voidsetRef(String ref)Sets the value for the ref attribute.-
Methods inherited from class net.sf.okapi.lib.xliff2.core.BaseList
add, clear, get, isEmpty, iterator, remove, remove, set, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
TAG_NAME
public static final String TAG_NAME
The tag element name constant.- See Also:
- Constant Field Values
-
APPLIES_TO_ATTR_NAME
public static final String APPLIES_TO_ATTR_NAME
appliesToattribute name.- See Also:
- Constant Field Values
-
REF_ATTR_NAME
public static final String REF_ATTR_NAME
refattribute name.- See Also:
- Constant Field Values
-
CURRENT_VERSION_ATTR_NAME
public static final String CURRENT_VERSION_ATTR_NAME
currentVersionattribute name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Revisions
public Revisions()
Default constructor. Creates a newRevisionsobject.
-
Revisions
public Revisions(String appliesTo)
Creates a newRevisionsobject.- Parameters:
appliesTo- the value for the REQUIRED attributeappliesTo.- See Also:
setAppliesTo(String)
-
-
Method Detail
-
setAppliesTo
public final void setAppliesTo(String appliesTo)
Sets the value to theappliesToattribute. It must be the name of any valid XLIFF element which is a sibling, or a child of a sibling element, to the change track module within the scope of the enclosing element. If a null or empty string is provided, anIllegalArgumentExceptionis thrown.- Parameters:
appliesTo- the value for the appliesTo attribute.
-
getAppliesTo
public String getAppliesTo()
Gets the value of the appliesTo attribute.- Returns:
- the value of the appliesTo attribute.
-
setRef
public void setRef(String ref)
Sets the value for the ref attribute.- Parameters:
ref- the value for the ref attribute.
-
getRef
public String getRef()
Gets the value for the ref attribute.- Returns:
- the value for the ref attribute (can be null).
-
setCurrentVersion
public void setCurrentVersion(String currentVersion)
Sets the value of thecurrentVersionattribute.- Parameters:
currentVersion- must be the value of theversionattribute of one of therevisionelements listed in the samerevisionselement.
-
getCurrentVersion
public String getCurrentVersion()
Gets the value of thecurrentVersionattribute.- Returns:
- the value of the
currentVersionattribute.
-
getExtAttributes
public ExtAttributes getExtAttributes()
Description copied from interface:IWithExtAttributesGets theExtAttributesobject for the parent object. If none exists, one is created.- Specified by:
getExtAttributesin interfaceIWithExtAttributes- Returns:
- the
ExtAttributesobject for the parent object, never null.
-
setExtAttributes
public void setExtAttributes(ExtAttributes attributes)
Description copied from interface:IWithExtAttributesSets theExtAttributesobject associated with this object.- Specified by:
setExtAttributesin interfaceIWithExtAttributes- Parameters:
attributes- theExtAttributesobject associated with this object. If null, a newExtAttributesobject is created.
-
hasExtAttribute
public boolean hasExtAttribute()
Description copied from interface:IWithExtAttributesIndicates if at least one extension attribute is present.- Specified by:
hasExtAttributein interfaceIWithExtAttributes- Returns:
- true if at least one extension attribute is present; false otherwise.
-
getExtAttributeValue
public String getExtAttributeValue(String namespaceURI, String localName)
Description copied from interface:IWithExtAttributesGets the value for a given extension attribute.- Specified by:
getExtAttributeValuein interfaceIWithExtAttributes- Parameters:
namespaceURI- the URI of the namespace for the attribute.localName- the name of the attribute.- Returns:
- the value of the extension attribute, or null if it does not exist.
-
getOpeningTagName
public String getOpeningTagName()
Gets the openingrevisionstag name.- Returns:
- the opening
revisionstag name.
-
getAttributesString
public String getAttributesString()
Gets the attributes string.- Returns:
- the attributes string.
-
getClosingTagName
public String getClosingTagName()
Gets the closingchangeTracktag name.- Returns:
- the closing
changeTracktag name.
-
getCompleteOpeningTag
public String getCompleteOpeningTag()
Gets the completerevisionsopening tag.- Returns:
- the complete
revisionsopening tag.
-
getClosingTag
public String getClosingTag()
Gets the completerevisionsclosing tag.- Returns:
- the complete
revisionsclosing tag.
-
-