Package net.sf.okapi.lib.xliff2.core
Class MTag
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
-
- net.sf.okapi.lib.xliff2.core.Tag
-
- net.sf.okapi.lib.xliff2.core.MTag
-
- All Implemented Interfaces:
IWithExtAttributes,IWithITSAttributes
- Direct Known Subclasses:
TermTag
public class MTag extends Tag implements IWithITSAttributes
Represents an opening or closing tag for an annotation marker.
-
-
Field Summary
Fields Modifier and Type Field Description protected MTagCommonmcstatic StringTYPE_DEFAULTDefault type of a marker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Indicates if this tag is equal to another.StringgetId()Gets the id for the code or annotation using this tag.ITSItemsgetITSItems()Gets the ITS items associated with this object.StringgetRef()Gets the URI reference for this marker.BooleangetTranslate()Gets the translate property for this marker.StringgetType()Gets the type of the code or marker this tag represents.StringgetValue()Gets the value for this marker.inthashCode()booleanhasITSItem()Indicates if the object has at least one ITS item.booleanisCode()Indicates if this tag is for a code (CTag).booleanisMarker()Indicates if this tag is for a marker (MTag).voidsetITSItems(ITSItems itsItems)Sets the list of the ITS items associated with this object.voidsetRef(String ref)Sets the URI reference for this marker (for both opening/closing tags).voidsetTagType(TagType markerType)Sets theTagTypevalue of this tag.voidsetTranslate(Boolean translate)Sets the translate property for this marker (for both opening/closing tags).voidsetType(String type)Sets the type of the code or marker (for both opening/closing tags).voidsetValue(String value)sets the value for this marker (for both opening/closing tags).-
Methods inherited from class net.sf.okapi.lib.xliff2.core.Tag
getTagType, toString
-
Methods inherited from class net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
getExtAttributes, getExtAttributeValue, hasExtAttribute, setExtAttributes
-
-
-
-
Field Detail
-
TYPE_DEFAULT
public static final String TYPE_DEFAULT
Default type of a marker.- See Also:
- Constant Field Values
-
mc
protected MTagCommon mc
-
-
Constructor Detail
-
MTag
public MTag(String id, String type)
Creates a new opening tag for a marker.- Parameters:
id- the ID of the new marker.type- the type of the new marker (can be null for the default type).
-
MTag
public MTag(MTag opposite)
Creates a new opening or closing tag for a marker.- Parameters:
opposite- the counterpart tag to connect to this new opening or closing tag.
-
-
Method Detail
-
setTagType
public void setTagType(TagType markerType)
Description copied from class:TagSets theTagTypevalue of this tag.- Overrides:
setTagTypein classTag- Parameters:
markerType- theTagTypeto set.
-
getId
public String getId()
Description copied from class:TagGets the id for the code or annotation using this tag.- Specified by:
getIdin interfaceIWithITSAttributes- Specified by:
getIdin classTag- Returns:
- the id for the code or annotation using this tag.
-
getType
public String getType()
Description copied from class:TagGets the type of the code or marker this tag represents.
-
setType
public void setType(String type)
Description copied from class:TagSets the type of the code or marker (for both opening/closing tags).
-
getRef
public String getRef()
Gets the URI reference for this marker.- Returns:
- the URI reference for this marker (can be null).
-
setRef
public void setRef(String ref)
Sets the URI reference for this marker (for both opening/closing tags).- Parameters:
ref- the new URI reference for this marker (can be null).
-
getValue
public String getValue()
Gets the value for this marker.- Returns:
- the value for this marker (can be null).
-
setValue
public void setValue(String value)
sets the value for this marker (for both opening/closing tags).- Parameters:
value- the new value for this marker.
-
getTranslate
public Boolean getTranslate()
Gets the translate property for this marker.- Returns:
- the translate property for this marker (can be null).
-
setTranslate
public void setTranslate(Boolean translate)
Sets the translate property for this marker (for both opening/closing tags).- Parameters:
translate- the new translate property (can be null).
-
equals
public boolean equals(Object other)
Description copied from class:TagIndicates if this tag is equal to another.Use the
==operator to test if two tags are the same.
-
isMarker
public boolean isMarker()
Description copied from class:TagIndicates if this tag is for a marker (MTag).
-
isCode
public boolean isCode()
Description copied from class:TagIndicates if this tag is for a code (CTag).
-
hasITSItem
public boolean hasITSItem()
Description copied from interface:IWithITSAttributesIndicates if the object has at least one ITS item.- Specified by:
hasITSItemin interfaceIWithITSAttributes- Returns:
- true if the object has at least one ITS item.
-
getITSItems
public ITSItems getITSItems()
Description copied from interface:IWithITSAttributesGets the ITS items associated with this object.- Specified by:
getITSItemsin interfaceIWithITSAttributes- Returns:
- the ITS items associated with this object (can be empty, but never null).
-
setITSItems
public void setITSItems(ITSItems itsItems)
Description copied from interface:IWithITSAttributesSets the list of the ITS items associated with this object.- Specified by:
setITSItemsin interfaceIWithITSAttributes- Parameters:
itsItems- the new items to set.
-
-