Package net.sf.okapi.lib.xliff2.core
Class Tag
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
-
- net.sf.okapi.lib.xliff2.core.Tag
-
- All Implemented Interfaces:
IWithExtAttributes
public abstract class Tag extends DataWithExtAttributes
Provides the common methods for code and marker tags.Any object deriving from this class must also provide an implementation for
CloneFactory.create(Tag, Tags).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Indicates if this tag is equal to another.abstract StringgetId()Gets the id for the code or annotation using this tag.TagTypegetTagType()Gets theTagTypevalue of this tag.abstract StringgetType()Gets the type of the code or marker this tag represents.inthashCode()abstract booleanisCode()Indicates if this tag is for a code (CTag).abstract booleanisMarker()Indicates if this tag is for a marker (MTag).voidsetTagType(TagType tagType)Sets theTagTypevalue of this tag.abstract voidsetType(String type)Sets the type of the code or marker (for both opening/closing tags).StringtoString()-
Methods inherited from class net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
getExtAttributes, getExtAttributeValue, hasExtAttribute, setExtAttributes
-
-
-
-
Field Detail
-
tagType
protected TagType tagType
-
-
Method Detail
-
getTagType
public TagType getTagType()
Gets theTagTypevalue of this tag.- Returns:
- the
TagTypevalue of this tag.
-
setTagType
public void setTagType(TagType tagType)
Sets theTagTypevalue of this tag.- Parameters:
tagType- theTagTypeto set.
-
getId
public abstract String getId()
Gets the id for the code or annotation using this tag.- Returns:
- the id for the code or annotation using this tag.
-
getType
public abstract String getType()
Gets the type of the code or marker this tag represents.- Returns:
- the type of the code or marker this tag represents.
If this is a
CTagthe type value can be null.
-
setType
public abstract void setType(String type)
Sets the type of the code or marker (for both opening/closing tags).- Parameters:
type- the type of the code or marker this tag represents.
-
isMarker
public abstract boolean isMarker()
Indicates if this tag is for a marker (MTag).
-
isCode
public abstract boolean isCode()
Indicates if this tag is for a code (CTag).
-
equals
public boolean equals(Object other)
Indicates if this tag is equal to another.Use the
==operator to test if two tags are the same.- Overrides:
equalsin classDataWithExtAttributes- Parameters:
other- the other tag to compare to this one.- Returns:
- true if both tags are equals.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDataWithExtAttributes
-
-