public class CTag extends Tag
Modifier and Type | Field and Description |
---|---|
protected net.sf.okapi.lib.xliff2.core.CTagCommon |
cc |
Constructor and Description |
---|
CTag(TagType tagType,
java.lang.String id,
java.lang.String data)
Creates a new code tag (without any link to another tag).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Tag tag)
Indicates if this tag is equal to another.
|
boolean |
getCanCopy()
Indicates if this code can be copied.
|
boolean |
getCanDelete()
Indicates if this code can be deleted.
|
boolean |
getCanOverlap()
Indicates if this spanning code can overlap others (i.e.
|
CanReorder |
getCanReorder()
Indicates if this code can be re-ordered.
|
java.lang.String |
getCopyOf()
Gets the ID of the code from which this code is a copy.
|
java.lang.String |
getData()
Gets the original data of this code's tag.
|
Directionality |
getDataDir()
Gets the directionality of the original data of this code's tag.
|
java.lang.String |
getDataRef()
Gets the ID of the element where this code's tag is stored.
|
Directionality |
getDir()
Gets the directionality of the content of this code.
|
java.lang.String |
getDisp()
Gets the user-friendly representation of the data of this code's tag.
|
java.lang.String |
getEquiv()
Gets the text equivalent representation of the data of this code's tag.
|
java.lang.String |
getId()
Gets the id for the code or annotation using this tag.
|
java.lang.String |
getSubFlows()
Gets the IDs of the units representing the sub-flows for this code's tag.
|
java.lang.String[] |
getSubFlowsIds()
Gets an array of the IDs of the units representing the sub-flows for this code's tag.
|
java.lang.String |
getSubType()
Gets the sub-type of this code.
|
java.lang.String |
getType()
Gets the type of the code or marker this tag represents.
|
boolean |
hasData()
Indicates if this code's tag has some content for its original data.
|
boolean |
isCode()
Indicates if this tag is for a code (
CTag ). |
boolean |
isInitialWithData()
Indicates if this code's tag had an original data initially (when read from the document).
|
boolean |
isMarker()
Indicates if this tag is for a marker (
MTag ). |
void |
setCanCopy(boolean canCopy)
Sets the flag indicating if this code can be copied (for both opening/closing tags).
|
void |
setCanDelete(boolean canDelete)
Sets the flag indicating if this code can be deleted (for both opening/closing tags).
|
void |
setCanOverlap(boolean canOverlap)
sets the flag indicating if this code can overlap others (for both opening/closing tags).
|
void |
setCanReorder(CanReorder canReorder)
Sets the flag indicating if this code can be re-ordered.
|
void |
setCopyOf(java.lang.String id)
Sets the ID of the code from which this code is a copy (for both opening/closing tags).
|
void |
setData(java.lang.String data)
Sets the original data of this code's tag.
|
void |
setDataDir(Directionality dir)
Sets the directionality of the original data of this code's tag.
|
void |
setDataRef(java.lang.String dataRef)
Sets the ID of the element where this code's tag is stored.
|
void |
setDir(Directionality dir)
Sets the directionality of the content of this code (for both opening/closing tags).
|
void |
setDisp(java.lang.String disp)
Sets the user-friendly representation of the data of this code's tag.
|
void |
setEquiv(java.lang.String equiv)
Sets the text equivalent representation of the data of this code's tag.
|
void |
setInitialWithData(boolean initialWithData)
Sets the flag indicating if this code's tag had an original data initially.
|
void |
setSubFlows(java.lang.String subFlows)
Sets the IDs of the units representing the sub-flows for this code's tag.
|
void |
setSubType(java.lang.String subType)
Sets the sub-type of this code (for both opening/closing tags).
|
void |
setType(java.lang.String type)
Sets the type of the code or marker (for both opening/closing tags).
|
void |
verifyTypeSubTypeValues()
Verifies the type and sub-type values.
|
getTagType, toString
getExtAttributes, getExtAttributeValue, hasExtAttribute, setExtAttributes
public CTag(TagType tagType, java.lang.String id, java.lang.String data)
tagType
- the tag type.id
- the id (should not be null).data
- the data (can be null).public boolean equals(Tag tag)
Tag
Use the ==
operator to test if two tags are the same.
tag
- the other tag to compare to this one.public boolean isCode()
Tag
CTag
).public boolean isMarker()
Tag
MTag
).public java.lang.String getId()
Tag
public java.lang.String getType()
Tag
public void setType(java.lang.String type)
Tag
public java.lang.String getSubType()
public void setSubType(java.lang.String subType)
subType
- the new sub-type of this code.public boolean getCanCopy()
public void setCanCopy(boolean canCopy)
canCopy
- true to allow this code to be copied, false otherwise.public boolean getCanOverlap()
public void setCanOverlap(boolean canOverlap)
canOverlap
- true to allow this code to overlap others, false otherwise.public boolean getCanDelete()
public void setCanDelete(boolean canDelete)
canDelete
- true to allow this code to be deleted, false otherwise.public CanReorder getCanReorder()
CanReorder
values. If the tag is a closing tag and
the code is set to CanReorder.FIRSTNO
this method return CanReorder.NO
as the
closing tag of a code cannot be a first-no (only an opening tag can be).public void setCanReorder(CanReorder canReorder)
CanReorder.YES
the canDelete
and canCopy
fields are set automatically to false.canReorder
- the new value for the flag indicating if this code can be re-ordered.public java.lang.String getCopyOf()
public void setCopyOf(java.lang.String id)
id
- the ID of the code from which this code was copied (can be null).public boolean hasData()
public java.lang.String getData()
public void setData(java.lang.String data)
data
- the original data of this code's tag (can be null).public java.lang.String getDataRef()
public void setDataRef(java.lang.String dataRef)
dataRef
- the ID of the element where this code's tag is stored (can be null).public boolean isInitialWithData()
public void setInitialWithData(boolean initialWithData)
initialWithData
- true to indicate that this code's tag had an original data initially.public Directionality getDataDir()
public void setDataDir(Directionality dir)
dir
- the new directionality of the original data of this code's tag.public java.lang.String getDisp()
public void setDisp(java.lang.String disp)
disp
- the new user-friendly representation of the data of this code's tag.public java.lang.String getEquiv()
public void setEquiv(java.lang.String equiv)
equiv
- the new text equivalent representation of the data of this code's tag.
A null value will result in an empty string representation.public java.lang.String getSubFlows()
public void setSubFlows(java.lang.String subFlows)
subFlows
- the new IDs of the units representing the sub-flows for this code's tag.public java.lang.String[] getSubFlowsIds()
public Directionality getDir()
public void setDir(Directionality dir)
dir
- the new directionality of the content of this code.public void verifyTypeSubTypeValues()
InvalidParameterException
- if a value is invalid.