public interface IContent
<source>
or <target>
.Modifier and Type | Method and Description |
---|---|
void |
append(char ch) |
ICode |
append(ICode code) |
void |
append(String plainText)
Appends a plain text string at the end of this content.
|
IAnnotation |
appendOpeningAnnotation(String id,
String type)
Appends an opening inline annotation to this content.
|
ICode |
appendOpeningCode(String id,
String data)
Appends an opening code to this content.
|
ICode |
appendStandaloneCode(String id,
String data)
Appends a standalone inline code to this content.
|
void |
clear()
Clears this content of all text and tags.
|
IAnnotation |
closeAnnotation(String id)
Appends a closing tag for an existing opened annotation.
|
ICode |
closeCode(String id,
String data)
Appends a closing tag for an existing opened code.
|
void |
delete(int start,
int end)
Deletes a span of content.
|
String |
getCodedText()
Gets the coded text for this content.
|
ITags |
getTags()
Gets the tag collection associated with this content.
|
boolean |
hasTag()
Indicates if this content has at least one tag reference.
|
ICode |
insert(int pos,
ICode code) |
void |
insert(int pos,
String plainText)
Inserts a plain text string at a given position in the coded text.
|
boolean |
isEmpty()
Indicates if this content has any text or tag reference.
|
boolean |
isTarget()
Indicates if this is a target content.
|
void |
setCodedText(String codedText)
Sets the coded text for this content.
|
void |
validate()
Verify if the current content is valid.
|
boolean isEmpty()
boolean isTarget()
boolean hasTag()
String getCodedText()
setCodedText(String)
,
getTags()
void setCodedText(String codedText)
getCodedText()
for more information on coded text.codedText
- the new coded text. It must have all the necessary tag references.getCodedText()
ITags getTags()
getCodedText()
void clear()
void delete(int start, int end)
start
- the first character to delete in the coded text.end
- the position after the last character to delete in the coded text.
You can use -1 to indicate the end of the content.void append(String plainText)
plainText
- the text to append.void append(char ch)
ICode appendOpeningCode(String id, String data)
id
- the id of the code.data
- the original data for the code, e.g. <B>
. (can be null).ICode
created.closeCode(String, String)
,
appendStandaloneCode(String, String)
ICode closeCode(String id, String data)
id
- the id of the code to close.data
- the original data for the code, e.g. </B>
. (can be null).ICode
created.appendOpeningCode(String, String)
ICode appendStandaloneCode(String id, String data)
id
- the id of the code.data
- the original data for the code, e.g. <BR>
. (can be null).ICode
created.appendOpeningCode(String, String)
IAnnotation appendOpeningAnnotation(String id, String type)
id
- the id of the annotation.type
- the type of the annotation.IAnnotation
created.IAnnotation closeAnnotation(String id)
id
- the id of the annotation to close.IAnnotation
created.void insert(int pos, String plainText)
pos
- the position where to insert.plainText
- the string to insert.InvalidPositionException
- if the position is inside a tag reference.void validate()